home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / C / Applications / Python 1.3.3 / Python 133 SRC / Mac / Modules / qt / Qtmodule.c < prev    next >
Text File  |  1996-04-12  |  164KB  |  6,011 lines

  1.  
  2. /* =========================== Module Qt ============================ */
  3.  
  4. #include "Python.h"
  5.  
  6.  
  7.  
  8. #define SystemSevenOrLater 1
  9.  
  10. #include "macglue.h"
  11. #include <Memory.h>
  12. #include <Dialogs.h>
  13. #include <Menus.h>
  14. #include <Controls.h>
  15.  
  16. extern PyObject *ResObj_New(Handle);
  17. extern int ResObj_Convert(PyObject *, Handle *);
  18. extern PyObject *OptResObj_New(Handle);
  19. extern int OptResObj_Convert(PyObject *, Handle *);
  20.  
  21. extern PyObject *WinObj_New(WindowPtr);
  22. extern int WinObj_Convert(PyObject *, WindowPtr *);
  23. extern PyTypeObject Window_Type;
  24. #define WinObj_Check(x) ((x)->ob_type == &Window_Type)
  25.  
  26. extern PyObject *DlgObj_New(DialogPtr);
  27. extern int DlgObj_Convert(PyObject *, DialogPtr *);
  28. extern PyTypeObject Dialog_Type;
  29. #define DlgObj_Check(x) ((x)->ob_type == &Dialog_Type)
  30.  
  31. extern PyObject *MenuObj_New(MenuHandle);
  32. extern int MenuObj_Convert(PyObject *, MenuHandle *);
  33.  
  34. extern PyObject *CtlObj_New(ControlHandle);
  35. extern int CtlObj_Convert(PyObject *, ControlHandle *);
  36.  
  37. extern PyObject *GrafObj_New(GrafPtr);
  38. extern int GrafObj_Convert(PyObject *, GrafPtr *);
  39.  
  40. extern PyObject *BMObj_New(BitMapPtr);
  41. extern int BMObj_Convert(PyObject *, BitMapPtr *);
  42.  
  43. extern PyObject *PMObj_New(PixMapHandle);
  44. extern int PMObj_Convert(PyObject *, PixMapHandle *);
  45.  
  46. extern PyObject *WinObj_WhichWindow(WindowPtr);
  47.  
  48. #include <Movies.h>
  49.  
  50. /* Exported by Cmmodule.c: */
  51. extern PyObject *CmpObj_New(Component);
  52. extern int CmpObj_Convert(PyObject *, Component *);
  53. extern PyObject *CmpInstObj_New(ComponentInstance);
  54. extern int CmpInstObj_Convert(PyObject *, ComponentInstance *);
  55.  
  56. /* Exported by Qdmodule.c: */
  57. extern PyObject *QdRGB_New(RGBColor *);
  58. extern int QdRGB_Convert(PyObject *, RGBColor *);
  59.  
  60. /* Our own, used before defined: */
  61. staticforward PyObject *TrackObj_New(Track);
  62. staticforward int TrackObj_Convert(PyObject *, Track *);
  63. staticforward PyObject *MovieObj_New(Movie);
  64. staticforward int MovieObj_Convert(PyObject *, Movie *);
  65. staticforward PyObject *MovieCtlObj_New(MovieController);
  66. staticforward int MovieCtlObj_Convert(PyObject *, MovieController *);
  67.  
  68.  
  69.  
  70. static PyObject *Qt_Error;
  71.  
  72. /* ------------------ Object type MovieController ------------------- */
  73.  
  74. PyTypeObject MovieController_Type;
  75.  
  76. #define MovieCtlObj_Check(x) ((x)->ob_type == &MovieController_Type)
  77.  
  78. typedef struct MovieControllerObject {
  79.     PyObject_HEAD
  80.     MovieController ob_itself;
  81. } MovieControllerObject;
  82.  
  83. PyObject *MovieCtlObj_New(itself)
  84.     MovieController itself;
  85. {
  86.     MovieControllerObject *it;
  87.     if (itself == NULL) {
  88.                         PyErr_SetString(Qt_Error,"Cannot create null MovieController");
  89.                         return NULL;
  90.                     }
  91.     it = PyObject_NEW(MovieControllerObject, &MovieController_Type);
  92.     if (it == NULL) return NULL;
  93.     it->ob_itself = itself;
  94.     return (PyObject *)it;
  95. }
  96. MovieCtlObj_Convert(v, p_itself)
  97.     PyObject *v;
  98.     MovieController *p_itself;
  99. {
  100.     if (!MovieCtlObj_Check(v))
  101.     {
  102.         PyErr_SetString(PyExc_TypeError, "MovieController required");
  103.         return 0;
  104.     }
  105.     *p_itself = ((MovieControllerObject *)v)->ob_itself;
  106.     return 1;
  107. }
  108.  
  109. static void MovieCtlObj_dealloc(self)
  110.     MovieControllerObject *self;
  111. {
  112.     DisposeMovieController(self->ob_itself);
  113.     PyMem_DEL(self);
  114. }
  115.  
  116. static PyObject *MovieCtlObj_MCSetMovie(_self, _args)
  117.     MovieControllerObject *_self;
  118.     PyObject *_args;
  119. {
  120.     PyObject *_res = NULL;
  121.     ComponentResult _rv;
  122.     Movie theMovie;
  123.     WindowPtr movieWindow;
  124.     Point where;
  125.     if (!PyArg_ParseTuple(_args, "O&O&O&",
  126.                           MovieObj_Convert, &theMovie,
  127.                           WinObj_Convert, &movieWindow,
  128.                           PyMac_GetPoint, &where))
  129.         return NULL;
  130.     _rv = MCSetMovie(_self->ob_itself,
  131.                      theMovie,
  132.                      movieWindow,
  133.                      where);
  134.     _res = Py_BuildValue("l",
  135.                          _rv);
  136.     return _res;
  137. }
  138.  
  139. static PyObject *MovieCtlObj_MCGetIndMovie(_self, _args)
  140.     MovieControllerObject *_self;
  141.     PyObject *_args;
  142. {
  143.     PyObject *_res = NULL;
  144.     Movie _rv;
  145.     short index;
  146.     if (!PyArg_ParseTuple(_args, "h",
  147.                           &index))
  148.         return NULL;
  149.     _rv = MCGetIndMovie(_self->ob_itself,
  150.                         index);
  151.     _res = Py_BuildValue("O&",
  152.                          MovieObj_New, _rv);
  153.     return _res;
  154. }
  155.  
  156. static PyObject *MovieCtlObj_MCRemoveMovie(_self, _args)
  157.     MovieControllerObject *_self;
  158.     PyObject *_args;
  159. {
  160.     PyObject *_res = NULL;
  161.     ComponentResult _rv;
  162.     if (!PyArg_ParseTuple(_args, ""))
  163.         return NULL;
  164.     _rv = MCRemoveMovie(_self->ob_itself);
  165.     _res = Py_BuildValue("l",
  166.                          _rv);
  167.     return _res;
  168. }
  169.  
  170. static PyObject *MovieCtlObj_MCIsPlayerEvent(_self, _args)
  171.     MovieControllerObject *_self;
  172.     PyObject *_args;
  173. {
  174.     PyObject *_res = NULL;
  175.     ComponentResult _rv;
  176.     EventRecord e;
  177.     if (!PyArg_ParseTuple(_args, "O&",
  178.                           PyMac_GetEventRecord, &e))
  179.         return NULL;
  180.     _rv = MCIsPlayerEvent(_self->ob_itself,
  181.                           &e);
  182.     _res = Py_BuildValue("l",
  183.                          _rv);
  184.     return _res;
  185. }
  186.  
  187. static PyObject *MovieCtlObj_MCDoAction(_self, _args)
  188.     MovieControllerObject *_self;
  189.     PyObject *_args;
  190. {
  191.     PyObject *_res = NULL;
  192.     ComponentResult _rv;
  193.     short action;
  194.     void * params;
  195.     if (!PyArg_ParseTuple(_args, "hs",
  196.                           &action,
  197.                           ¶ms))
  198.         return NULL;
  199.     _rv = MCDoAction(_self->ob_itself,
  200.                      action,
  201.                      params);
  202.     _res = Py_BuildValue("l",
  203.                          _rv);
  204.     return _res;
  205. }
  206.  
  207. static PyObject *MovieCtlObj_MCSetControllerAttached(_self, _args)
  208.     MovieControllerObject *_self;
  209.     PyObject *_args;
  210. {
  211.     PyObject *_res = NULL;
  212.     ComponentResult _rv;
  213.     Boolean attach;
  214.     if (!PyArg_ParseTuple(_args, "b",
  215.                           &attach))
  216.         return NULL;
  217.     _rv = MCSetControllerAttached(_self->ob_itself,
  218.                                   attach);
  219.     _res = Py_BuildValue("l",
  220.                          _rv);
  221.     return _res;
  222. }
  223.  
  224. static PyObject *MovieCtlObj_MCIsControllerAttached(_self, _args)
  225.     MovieControllerObject *_self;
  226.     PyObject *_args;
  227. {
  228.     PyObject *_res = NULL;
  229.     ComponentResult _rv;
  230.     if (!PyArg_ParseTuple(_args, ""))
  231.         return NULL;
  232.     _rv = MCIsControllerAttached(_self->ob_itself);
  233.     _res = Py_BuildValue("l",
  234.                          _rv);
  235.     return _res;
  236. }
  237.  
  238. static PyObject *MovieCtlObj_MCSetVisible(_self, _args)
  239.     MovieControllerObject *_self;
  240.     PyObject *_args;
  241. {
  242.     PyObject *_res = NULL;
  243.     ComponentResult _rv;
  244.     Boolean visible;
  245.     if (!PyArg_ParseTuple(_args, "b",
  246.                           &visible))
  247.         return NULL;
  248.     _rv = MCSetVisible(_self->ob_itself,
  249.                        visible);
  250.     _res = Py_BuildValue("l",
  251.                          _rv);
  252.     return _res;
  253. }
  254.  
  255. static PyObject *MovieCtlObj_MCGetVisible(_self, _args)
  256.     MovieControllerObject *_self;
  257.     PyObject *_args;
  258. {
  259.     PyObject *_res = NULL;
  260.     ComponentResult _rv;
  261.     if (!PyArg_ParseTuple(_args, ""))
  262.         return NULL;
  263.     _rv = MCGetVisible(_self->ob_itself);
  264.     _res = Py_BuildValue("l",
  265.                          _rv);
  266.     return _res;
  267. }
  268.  
  269. static PyObject *MovieCtlObj_MCGetControllerBoundsRect(_self, _args)
  270.     MovieControllerObject *_self;
  271.     PyObject *_args;
  272. {
  273.     PyObject *_res = NULL;
  274.     ComponentResult _rv;
  275.     Rect bounds;
  276.     if (!PyArg_ParseTuple(_args, ""))
  277.         return NULL;
  278.     _rv = MCGetControllerBoundsRect(_self->ob_itself,
  279.                                     &bounds);
  280.     _res = Py_BuildValue("lO&",
  281.                          _rv,
  282.                          PyMac_BuildRect, &bounds);
  283.     return _res;
  284. }
  285.  
  286. static PyObject *MovieCtlObj_MCSetControllerBoundsRect(_self, _args)
  287.     MovieControllerObject *_self;
  288.     PyObject *_args;
  289. {
  290.     PyObject *_res = NULL;
  291.     ComponentResult _rv;
  292.     Rect bounds;
  293.     if (!PyArg_ParseTuple(_args, "O&",
  294.                           PyMac_GetRect, &bounds))
  295.         return NULL;
  296.     _rv = MCSetControllerBoundsRect(_self->ob_itself,
  297.                                     &bounds);
  298.     _res = Py_BuildValue("l",
  299.                          _rv);
  300.     return _res;
  301. }
  302.  
  303. static PyObject *MovieCtlObj_MCGetControllerBoundsRgn(_self, _args)
  304.     MovieControllerObject *_self;
  305.     PyObject *_args;
  306. {
  307.     PyObject *_res = NULL;
  308.     RgnHandle _rv;
  309.     if (!PyArg_ParseTuple(_args, ""))
  310.         return NULL;
  311.     _rv = MCGetControllerBoundsRgn(_self->ob_itself);
  312.     _res = Py_BuildValue("O&",
  313.                          ResObj_New, _rv);
  314.     return _res;
  315. }
  316.  
  317. static PyObject *MovieCtlObj_MCGetWindowRgn(_self, _args)
  318.     MovieControllerObject *_self;
  319.     PyObject *_args;
  320. {
  321.     PyObject *_res = NULL;
  322.     RgnHandle _rv;
  323.     WindowPtr w;
  324.     if (!PyArg_ParseTuple(_args, "O&",
  325.                           WinObj_Convert, &w))
  326.         return NULL;
  327.     _rv = MCGetWindowRgn(_self->ob_itself,
  328.                          w);
  329.     _res = Py_BuildValue("O&",
  330.                          ResObj_New, _rv);
  331.     return _res;
  332. }
  333.  
  334. static PyObject *MovieCtlObj_MCMovieChanged(_self, _args)
  335.     MovieControllerObject *_self;
  336.     PyObject *_args;
  337. {
  338.     PyObject *_res = NULL;
  339.     ComponentResult _rv;
  340.     Movie m;
  341.     if (!PyArg_ParseTuple(_args, "O&",
  342.                           MovieObj_Convert, &m))
  343.         return NULL;
  344.     _rv = MCMovieChanged(_self->ob_itself,
  345.                          m);
  346.     _res = Py_BuildValue("l",
  347.                          _rv);
  348.     return _res;
  349. }
  350.  
  351. static PyObject *MovieCtlObj_MCSetDuration(_self, _args)
  352.     MovieControllerObject *_self;
  353.     PyObject *_args;
  354. {
  355.     PyObject *_res = NULL;
  356.     ComponentResult _rv;
  357.     TimeValue duration;
  358.     if (!PyArg_ParseTuple(_args, "l",
  359.                           &duration))
  360.         return NULL;
  361.     _rv = MCSetDuration(_self->ob_itself,
  362.                         duration);
  363.     _res = Py_BuildValue("l",
  364.                          _rv);
  365.     return _res;
  366. }
  367.  
  368. static PyObject *MovieCtlObj_MCGetCurrentTime(_self, _args)
  369.     MovieControllerObject *_self;
  370.     PyObject *_args;
  371. {
  372.     PyObject *_res = NULL;
  373.     TimeValue _rv;
  374.     TimeScale scale;
  375.     if (!PyArg_ParseTuple(_args, ""))
  376.         return NULL;
  377.     _rv = MCGetCurrentTime(_self->ob_itself,
  378.                            &scale);
  379.     _res = Py_BuildValue("ll",
  380.                          _rv,
  381.                          scale);
  382.     return _res;
  383. }
  384.  
  385. static PyObject *MovieCtlObj_MCNewAttachedController(_self, _args)
  386.     MovieControllerObject *_self;
  387.     PyObject *_args;
  388. {
  389.     PyObject *_res = NULL;
  390.     ComponentResult _rv;
  391.     Movie theMovie;
  392.     WindowPtr w;
  393.     Point where;
  394.     if (!PyArg_ParseTuple(_args, "O&O&O&",
  395.                           MovieObj_Convert, &theMovie,
  396.                           WinObj_Convert, &w,
  397.                           PyMac_GetPoint, &where))
  398.         return NULL;
  399.     _rv = MCNewAttachedController(_self->ob_itself,
  400.                                   theMovie,
  401.                                   w,
  402.                                   where);
  403.     _res = Py_BuildValue("l",
  404.                          _rv);
  405.     return _res;
  406. }
  407.  
  408. static PyObject *MovieCtlObj_MCDraw(_self, _args)
  409.     MovieControllerObject *_self;
  410.     PyObject *_args;
  411. {
  412.     PyObject *_res = NULL;
  413.     ComponentResult _rv;
  414.     WindowPtr w;
  415.     if (!PyArg_ParseTuple(_args, "O&",
  416.                           WinObj_Convert, &w))
  417.         return NULL;
  418.     _rv = MCDraw(_self->ob_itself,
  419.                  w);
  420.     _res = Py_BuildValue("l",
  421.                          _rv);
  422.     return _res;
  423. }
  424.  
  425. static PyObject *MovieCtlObj_MCActivate(_self, _args)
  426.     MovieControllerObject *_self;
  427.     PyObject *_args;
  428. {
  429.     PyObject *_res = NULL;
  430.     ComponentResult _rv;
  431.     WindowPtr w;
  432.     Boolean activate;
  433.     if (!PyArg_ParseTuple(_args, "O&b",
  434.                           WinObj_Convert, &w,
  435.                           &activate))
  436.         return NULL;
  437.     _rv = MCActivate(_self->ob_itself,
  438.                      w,
  439.                      activate);
  440.     _res = Py_BuildValue("l",
  441.                          _rv);
  442.     return _res;
  443. }
  444.  
  445. static PyObject *MovieCtlObj_MCIdle(_self, _args)
  446.     MovieControllerObject *_self;
  447.     PyObject *_args;
  448. {
  449.     PyObject *_res = NULL;
  450.     ComponentResult _rv;
  451.     if (!PyArg_ParseTuple(_args, ""))
  452.         return NULL;
  453.     _rv = MCIdle(_self->ob_itself);
  454.     _res = Py_BuildValue("l",
  455.                          _rv);
  456.     return _res;
  457. }
  458.  
  459. static PyObject *MovieCtlObj_MCKey(_self, _args)
  460.     MovieControllerObject *_self;
  461.     PyObject *_args;
  462. {
  463.     PyObject *_res = NULL;
  464.     ComponentResult _rv;
  465.     SInt8 key;
  466.     long modifiers;
  467.     if (!PyArg_ParseTuple(_args, "bl",
  468.                           &key,
  469.                           &modifiers))
  470.         return NULL;
  471.     _rv = MCKey(_self->ob_itself,
  472.                 key,
  473.                 modifiers);
  474.     _res = Py_BuildValue("l",
  475.                          _rv);
  476.     return _res;
  477. }
  478.  
  479. static PyObject *MovieCtlObj_MCClick(_self, _args)
  480.     MovieControllerObject *_self;
  481.     PyObject *_args;
  482. {
  483.     PyObject *_res = NULL;
  484.     ComponentResult _rv;
  485.     WindowPtr w;
  486.     Point where;
  487.     long when;
  488.     long modifiers;
  489.     if (!PyArg_ParseTuple(_args, "O&O&ll",
  490.                           WinObj_Convert, &w,
  491.                           PyMac_GetPoint, &where,
  492.                           &when,
  493.                           &modifiers))
  494.         return NULL;
  495.     _rv = MCClick(_self->ob_itself,
  496.                   w,
  497.                   where,
  498.                   when,
  499.                   modifiers);
  500.     _res = Py_BuildValue("l",
  501.                          _rv);
  502.     return _res;
  503. }
  504.  
  505. static PyObject *MovieCtlObj_MCEnableEditing(_self, _args)
  506.     MovieControllerObject *_self;
  507.     PyObject *_args;
  508. {
  509.     PyObject *_res = NULL;
  510.     ComponentResult _rv;
  511.     Boolean enabled;
  512.     if (!PyArg_ParseTuple(_args, "b",
  513.                           &enabled))
  514.         return NULL;
  515.     _rv = MCEnableEditing(_self->ob_itself,
  516.                           enabled);
  517.     _res = Py_BuildValue("l",
  518.                          _rv);
  519.     return _res;
  520. }
  521.  
  522. static PyObject *MovieCtlObj_MCIsEditingEnabled(_self, _args)
  523.     MovieControllerObject *_self;
  524.     PyObject *_args;
  525. {
  526.     PyObject *_res = NULL;
  527.     long _rv;
  528.     if (!PyArg_ParseTuple(_args, ""))
  529.         return NULL;
  530.     _rv = MCIsEditingEnabled(_self->ob_itself);
  531.     _res = Py_BuildValue("l",
  532.                          _rv);
  533.     return _res;
  534. }
  535.  
  536. static PyObject *MovieCtlObj_MCCopy(_self, _args)
  537.     MovieControllerObject *_self;
  538.     PyObject *_args;
  539. {
  540.     PyObject *_res = NULL;
  541.     Movie _rv;
  542.     if (!PyArg_ParseTuple(_args, ""))
  543.         return NULL;
  544.     _rv = MCCopy(_self->ob_itself);
  545.     _res = Py_BuildValue("O&",
  546.                          MovieObj_New, _rv);
  547.     return _res;
  548. }
  549.  
  550. static PyObject *MovieCtlObj_MCCut(_self, _args)
  551.     MovieControllerObject *_self;
  552.     PyObject *_args;
  553. {
  554.     PyObject *_res = NULL;
  555.     Movie _rv;
  556.     if (!PyArg_ParseTuple(_args, ""))
  557.         return NULL;
  558.     _rv = MCCut(_self->ob_itself);
  559.     _res = Py_BuildValue("O&",
  560.                          MovieObj_New, _rv);
  561.     return _res;
  562. }
  563.  
  564. static PyObject *MovieCtlObj_MCPaste(_self, _args)
  565.     MovieControllerObject *_self;
  566.     PyObject *_args;
  567. {
  568.     PyObject *_res = NULL;
  569.     ComponentResult _rv;
  570.     Movie srcMovie;
  571.     if (!PyArg_ParseTuple(_args, "O&",
  572.                           MovieObj_Convert, &srcMovie))
  573.         return NULL;
  574.     _rv = MCPaste(_self->ob_itself,
  575.                   srcMovie);
  576.     _res = Py_BuildValue("l",
  577.                          _rv);
  578.     return _res;
  579. }
  580.  
  581. static PyObject *MovieCtlObj_MCClear(_self, _args)
  582.     MovieControllerObject *_self;
  583.     PyObject *_args;
  584. {
  585.     PyObject *_res = NULL;
  586.     ComponentResult _rv;
  587.     if (!PyArg_ParseTuple(_args, ""))
  588.         return NULL;
  589.     _rv = MCClear(_self->ob_itself);
  590.     _res = Py_BuildValue("l",
  591.                          _rv);
  592.     return _res;
  593. }
  594.  
  595. static PyObject *MovieCtlObj_MCUndo(_self, _args)
  596.     MovieControllerObject *_self;
  597.     PyObject *_args;
  598. {
  599.     PyObject *_res = NULL;
  600.     ComponentResult _rv;
  601.     if (!PyArg_ParseTuple(_args, ""))
  602.         return NULL;
  603.     _rv = MCUndo(_self->ob_itself);
  604.     _res = Py_BuildValue("l",
  605.                          _rv);
  606.     return _res;
  607. }
  608.  
  609. static PyObject *MovieCtlObj_MCPositionController(_self, _args)
  610.     MovieControllerObject *_self;
  611.     PyObject *_args;
  612. {
  613.     PyObject *_res = NULL;
  614.     ComponentResult _rv;
  615.     Rect movieRect;
  616.     Rect controllerRect;
  617.     long someFlags;
  618.     if (!PyArg_ParseTuple(_args, "O&O&l",
  619.                           PyMac_GetRect, &movieRect,
  620.                           PyMac_GetRect, &controllerRect,
  621.                           &someFlags))
  622.         return NULL;
  623.     _rv = MCPositionController(_self->ob_itself,
  624.                                &movieRect,
  625.                                &controllerRect,
  626.                                someFlags);
  627.     _res = Py_BuildValue("l",
  628.                          _rv);
  629.     return _res;
  630. }
  631.  
  632. static PyObject *MovieCtlObj_MCGetControllerInfo(_self, _args)
  633.     MovieControllerObject *_self;
  634.     PyObject *_args;
  635. {
  636.     PyObject *_res = NULL;
  637.     ComponentResult _rv;
  638.     long someFlags;
  639.     if (!PyArg_ParseTuple(_args, ""))
  640.         return NULL;
  641.     _rv = MCGetControllerInfo(_self->ob_itself,
  642.                               &someFlags);
  643.     _res = Py_BuildValue("ll",
  644.                          _rv,
  645.                          someFlags);
  646.     return _res;
  647. }
  648.  
  649. static PyObject *MovieCtlObj_MCSetClip(_self, _args)
  650.     MovieControllerObject *_self;
  651.     PyObject *_args;
  652. {
  653.     PyObject *_res = NULL;
  654.     ComponentResult _rv;
  655.     RgnHandle theClip;
  656.     RgnHandle movieClip;
  657.     if (!PyArg_ParseTuple(_args, "O&O&",
  658.                           ResObj_Convert, &theClip,
  659.                           ResObj_Convert, &movieClip))
  660.         return NULL;
  661.     _rv = MCSetClip(_self->ob_itself,
  662.                     theClip,
  663.                     movieClip);
  664.     _res = Py_BuildValue("l",
  665.                          _rv);
  666.     return _res;
  667. }
  668.  
  669. static PyObject *MovieCtlObj_MCGetClip(_self, _args)
  670.     MovieControllerObject *_self;
  671.     PyObject *_args;
  672. {
  673.     PyObject *_res = NULL;
  674.     ComponentResult _rv;
  675.     RgnHandle theClip;
  676.     RgnHandle movieClip;
  677.     if (!PyArg_ParseTuple(_args, ""))
  678.         return NULL;
  679.     _rv = MCGetClip(_self->ob_itself,
  680.                     &theClip,
  681.                     &movieClip);
  682.     _res = Py_BuildValue("lO&O&",
  683.                          _rv,
  684.                          ResObj_New, theClip,
  685.                          ResObj_New, movieClip);
  686.     return _res;
  687. }
  688.  
  689. static PyObject *MovieCtlObj_MCDrawBadge(_self, _args)
  690.     MovieControllerObject *_self;
  691.     PyObject *_args;
  692. {
  693.     PyObject *_res = NULL;
  694.     ComponentResult _rv;
  695.     RgnHandle movieRgn;
  696.     RgnHandle badgeRgn;
  697.     if (!PyArg_ParseTuple(_args, "O&",
  698.                           ResObj_Convert, &movieRgn))
  699.         return NULL;
  700.     _rv = MCDrawBadge(_self->ob_itself,
  701.                       movieRgn,
  702.                       &badgeRgn);
  703.     _res = Py_BuildValue("lO&",
  704.                          _rv,
  705.                          ResObj_New, badgeRgn);
  706.     return _res;
  707. }
  708.  
  709. static PyObject *MovieCtlObj_MCSetUpEditMenu(_self, _args)
  710.     MovieControllerObject *_self;
  711.     PyObject *_args;
  712. {
  713.     PyObject *_res = NULL;
  714.     ComponentResult _rv;
  715.     long modifiers;
  716.     MenuHandle mh;
  717.     if (!PyArg_ParseTuple(_args, "lO&",
  718.                           &modifiers,
  719.                           MenuObj_Convert, &mh))
  720.         return NULL;
  721.     _rv = MCSetUpEditMenu(_self->ob_itself,
  722.                           modifiers,
  723.                           mh);
  724.     _res = Py_BuildValue("l",
  725.                          _rv);
  726.     return _res;
  727. }
  728.  
  729. static PyObject *MovieCtlObj_MCGetMenuString(_self, _args)
  730.     MovieControllerObject *_self;
  731.     PyObject *_args;
  732. {
  733.     PyObject *_res = NULL;
  734.     ComponentResult _rv;
  735.     long modifiers;
  736.     short item;
  737.     Str255 aString;
  738.     if (!PyArg_ParseTuple(_args, "lhO&",
  739.                           &modifiers,
  740.                           &item,
  741.                           PyMac_GetStr255, aString))
  742.         return NULL;
  743.     _rv = MCGetMenuString(_self->ob_itself,
  744.                           modifiers,
  745.                           item,
  746.                           aString);
  747.     _res = Py_BuildValue("l",
  748.                          _rv);
  749.     return _res;
  750. }
  751.  
  752. static PyMethodDef MovieCtlObj_methods[] = {
  753.     {"MCSetMovie", (PyCFunction)MovieCtlObj_MCSetMovie, 1,
  754.      "(Movie theMovie, WindowPtr movieWindow, Point where) -> (ComponentResult _rv)"},
  755.     {"MCGetIndMovie", (PyCFunction)MovieCtlObj_MCGetIndMovie, 1,
  756.      "(short index) -> (Movie _rv)"},
  757.     {"MCRemoveMovie", (PyCFunction)MovieCtlObj_MCRemoveMovie, 1,
  758.      "() -> (ComponentResult _rv)"},
  759.     {"MCIsPlayerEvent", (PyCFunction)MovieCtlObj_MCIsPlayerEvent, 1,
  760.      "(EventRecord e) -> (ComponentResult _rv)"},
  761.     {"MCDoAction", (PyCFunction)MovieCtlObj_MCDoAction, 1,
  762.      "(short action, void * params) -> (ComponentResult _rv)"},
  763.     {"MCSetControllerAttached", (PyCFunction)MovieCtlObj_MCSetControllerAttached, 1,
  764.      "(Boolean attach) -> (ComponentResult _rv)"},
  765.     {"MCIsControllerAttached", (PyCFunction)MovieCtlObj_MCIsControllerAttached, 1,
  766.      "() -> (ComponentResult _rv)"},
  767.     {"MCSetVisible", (PyCFunction)MovieCtlObj_MCSetVisible, 1,
  768.      "(Boolean visible) -> (ComponentResult _rv)"},
  769.     {"MCGetVisible", (PyCFunction)MovieCtlObj_MCGetVisible, 1,
  770.      "() -> (ComponentResult _rv)"},
  771.     {"MCGetControllerBoundsRect", (PyCFunction)MovieCtlObj_MCGetControllerBoundsRect, 1,
  772.      "() -> (ComponentResult _rv, Rect bounds)"},
  773.     {"MCSetControllerBoundsRect", (PyCFunction)MovieCtlObj_MCSetControllerBoundsRect, 1,
  774.      "(Rect bounds) -> (ComponentResult _rv)"},
  775.     {"MCGetControllerBoundsRgn", (PyCFunction)MovieCtlObj_MCGetControllerBoundsRgn, 1,
  776.      "() -> (RgnHandle _rv)"},
  777.     {"MCGetWindowRgn", (PyCFunction)MovieCtlObj_MCGetWindowRgn, 1,
  778.      "(WindowPtr w) -> (RgnHandle _rv)"},
  779.     {"MCMovieChanged", (PyCFunction)MovieCtlObj_MCMovieChanged, 1,
  780.      "(Movie m) -> (ComponentResult _rv)"},
  781.     {"MCSetDuration", (PyCFunction)MovieCtlObj_MCSetDuration, 1,
  782.      "(TimeValue duration) -> (ComponentResult _rv)"},
  783.     {"MCGetCurrentTime", (PyCFunction)MovieCtlObj_MCGetCurrentTime, 1,
  784.      "() -> (TimeValue _rv, TimeScale scale)"},
  785.     {"MCNewAttachedController", (PyCFunction)MovieCtlObj_MCNewAttachedController, 1,
  786.      "(Movie theMovie, WindowPtr w, Point where) -> (ComponentResult _rv)"},
  787.     {"MCDraw", (PyCFunction)MovieCtlObj_MCDraw, 1,
  788.      "(WindowPtr w) -> (ComponentResult _rv)"},
  789.     {"MCActivate", (PyCFunction)MovieCtlObj_MCActivate, 1,
  790.      "(WindowPtr w, Boolean activate) -> (ComponentResult _rv)"},
  791.     {"MCIdle", (PyCFunction)MovieCtlObj_MCIdle, 1,
  792.      "() -> (ComponentResult _rv)"},
  793.     {"MCKey", (PyCFunction)MovieCtlObj_MCKey, 1,
  794.      "(SInt8 key, long modifiers) -> (ComponentResult _rv)"},
  795.     {"MCClick", (PyCFunction)MovieCtlObj_MCClick, 1,
  796.      "(WindowPtr w, Point where, long when, long modifiers) -> (ComponentResult _rv)"},
  797.     {"MCEnableEditing", (PyCFunction)MovieCtlObj_MCEnableEditing, 1,
  798.      "(Boolean enabled) -> (ComponentResult _rv)"},
  799.     {"MCIsEditingEnabled", (PyCFunction)MovieCtlObj_MCIsEditingEnabled, 1,
  800.      "() -> (long _rv)"},
  801.     {"MCCopy", (PyCFunction)MovieCtlObj_MCCopy, 1,
  802.      "() -> (Movie _rv)"},
  803.     {"MCCut", (PyCFunction)MovieCtlObj_MCCut, 1,
  804.      "() -> (Movie _rv)"},
  805.     {"MCPaste", (PyCFunction)MovieCtlObj_MCPaste, 1,
  806.      "(Movie srcMovie) -> (ComponentResult _rv)"},
  807.     {"MCClear", (PyCFunction)MovieCtlObj_MCClear, 1,
  808.      "() -> (ComponentResult _rv)"},
  809.     {"MCUndo", (PyCFunction)MovieCtlObj_MCUndo, 1,
  810.      "() -> (ComponentResult _rv)"},
  811.     {"MCPositionController", (PyCFunction)MovieCtlObj_MCPositionController, 1,
  812.      "(Rect movieRect, Rect controllerRect, long someFlags) -> (ComponentResult _rv)"},
  813.     {"MCGetControllerInfo", (PyCFunction)MovieCtlObj_MCGetControllerInfo, 1,
  814.      "() -> (ComponentResult _rv, long someFlags)"},
  815.     {"MCSetClip", (PyCFunction)MovieCtlObj_MCSetClip, 1,
  816.      "(RgnHandle theClip, RgnHandle movieClip) -> (ComponentResult _rv)"},
  817.     {"MCGetClip", (PyCFunction)MovieCtlObj_MCGetClip, 1,
  818.      "() -> (ComponentResult _rv, RgnHandle theClip, RgnHandle movieClip)"},
  819.     {"MCDrawBadge", (PyCFunction)MovieCtlObj_MCDrawBadge, 1,
  820.      "(RgnHandle movieRgn) -> (ComponentResult _rv, RgnHandle badgeRgn)"},
  821.     {"MCSetUpEditMenu", (PyCFunction)MovieCtlObj_MCSetUpEditMenu, 1,
  822.      "(long modifiers, MenuHandle mh) -> (ComponentResult _rv)"},
  823.     {"MCGetMenuString", (PyCFunction)MovieCtlObj_MCGetMenuString, 1,
  824.      "(long modifiers, short item, Str255 aString) -> (ComponentResult _rv)"},
  825.     {NULL, NULL, 0}
  826. };
  827.  
  828. PyMethodChain MovieCtlObj_chain = { MovieCtlObj_methods, NULL };
  829.  
  830. static PyObject *MovieCtlObj_getattr(self, name)
  831.     MovieControllerObject *self;
  832.     char *name;
  833. {
  834.     return Py_FindMethodInChain(&MovieCtlObj_chain, (PyObject *)self, name);
  835. }
  836.  
  837. #define MovieCtlObj_setattr NULL
  838.  
  839. PyTypeObject MovieController_Type = {
  840.     PyObject_HEAD_INIT(&PyType_Type)
  841.     0, /*ob_size*/
  842.     "MovieController", /*tp_name*/
  843.     sizeof(MovieControllerObject), /*tp_basicsize*/
  844.     0, /*tp_itemsize*/
  845.     /* methods */
  846.     (destructor) MovieCtlObj_dealloc, /*tp_dealloc*/
  847.     0, /*tp_print*/
  848.     (getattrfunc) MovieCtlObj_getattr, /*tp_getattr*/
  849.     (setattrfunc) MovieCtlObj_setattr, /*tp_setattr*/
  850. };
  851.  
  852. /* ---------------- End object type MovieController ----------------- */
  853.  
  854.  
  855. /* ---------------------- Object type TimeBase ---------------------- */
  856.  
  857. PyTypeObject TimeBase_Type;
  858.  
  859. #define TimeBaseObj_Check(x) ((x)->ob_type == &TimeBase_Type)
  860.  
  861. typedef struct TimeBaseObject {
  862.     PyObject_HEAD
  863.     TimeBase ob_itself;
  864. } TimeBaseObject;
  865.  
  866. PyObject *TimeBaseObj_New(itself)
  867.     TimeBase itself;
  868. {
  869.     TimeBaseObject *it;
  870.     if (itself == NULL) {
  871.                         PyErr_SetString(Qt_Error,"Cannot create null TimeBase");
  872.                         return NULL;
  873.                     }
  874.     it = PyObject_NEW(TimeBaseObject, &TimeBase_Type);
  875.     if (it == NULL) return NULL;
  876.     it->ob_itself = itself;
  877.     return (PyObject *)it;
  878. }
  879. TimeBaseObj_Convert(v, p_itself)
  880.     PyObject *v;
  881.     TimeBase *p_itself;
  882. {
  883.     if (!TimeBaseObj_Check(v))
  884.     {
  885.         PyErr_SetString(PyExc_TypeError, "TimeBase required");
  886.         return 0;
  887.     }
  888.     *p_itself = ((TimeBaseObject *)v)->ob_itself;
  889.     return 1;
  890. }
  891.  
  892. static void TimeBaseObj_dealloc(self)
  893.     TimeBaseObject *self;
  894. {
  895.     DisposeTimeBase(self->ob_itself);
  896.     PyMem_DEL(self);
  897. }
  898.  
  899. static PyObject *TimeBaseObj_SetTimeBaseValue(_self, _args)
  900.     TimeBaseObject *_self;
  901.     PyObject *_args;
  902. {
  903.     PyObject *_res = NULL;
  904.     TimeValue t;
  905.     TimeScale s;
  906.     if (!PyArg_ParseTuple(_args, "ll",
  907.                           &t,
  908.                           &s))
  909.         return NULL;
  910.     SetTimeBaseValue(_self->ob_itself,
  911.                      t,
  912.                      s);
  913.     Py_INCREF(Py_None);
  914.     _res = Py_None;
  915.     return _res;
  916. }
  917.  
  918. static PyObject *TimeBaseObj_GetTimeBaseRate(_self, _args)
  919.     TimeBaseObject *_self;
  920.     PyObject *_args;
  921. {
  922.     PyObject *_res = NULL;
  923.     Fixed _rv;
  924.     if (!PyArg_ParseTuple(_args, ""))
  925.         return NULL;
  926.     _rv = GetTimeBaseRate(_self->ob_itself);
  927.     _res = Py_BuildValue("O&",
  928.                          PyMac_BuildFixed, _rv);
  929.     return _res;
  930. }
  931.  
  932. static PyObject *TimeBaseObj_SetTimeBaseRate(_self, _args)
  933.     TimeBaseObject *_self;
  934.     PyObject *_args;
  935. {
  936.     PyObject *_res = NULL;
  937.     Fixed r;
  938.     if (!PyArg_ParseTuple(_args, "O&",
  939.                           PyMac_GetFixed, &r))
  940.         return NULL;
  941.     SetTimeBaseRate(_self->ob_itself,
  942.                     r);
  943.     Py_INCREF(Py_None);
  944.     _res = Py_None;
  945.     return _res;
  946. }
  947.  
  948. static PyObject *TimeBaseObj_GetTimeBaseFlags(_self, _args)
  949.     TimeBaseObject *_self;
  950.     PyObject *_args;
  951. {
  952.     PyObject *_res = NULL;
  953.     long _rv;
  954.     if (!PyArg_ParseTuple(_args, ""))
  955.         return NULL;
  956.     _rv = GetTimeBaseFlags(_self->ob_itself);
  957.     _res = Py_BuildValue("l",
  958.                          _rv);
  959.     return _res;
  960. }
  961.  
  962. static PyObject *TimeBaseObj_SetTimeBaseFlags(_self, _args)
  963.     TimeBaseObject *_self;
  964.     PyObject *_args;
  965. {
  966.     PyObject *_res = NULL;
  967.     long timeBaseFlags;
  968.     if (!PyArg_ParseTuple(_args, "l",
  969.                           &timeBaseFlags))
  970.         return NULL;
  971.     SetTimeBaseFlags(_self->ob_itself,
  972.                      timeBaseFlags);
  973.     Py_INCREF(Py_None);
  974.     _res = Py_None;
  975.     return _res;
  976. }
  977.  
  978. static PyObject *TimeBaseObj_GetTimeBaseMasterTimeBase(_self, _args)
  979.     TimeBaseObject *_self;
  980.     PyObject *_args;
  981. {
  982.     PyObject *_res = NULL;
  983.     TimeBase _rv;
  984.     if (!PyArg_ParseTuple(_args, ""))
  985.         return NULL;
  986.     _rv = GetTimeBaseMasterTimeBase(_self->ob_itself);
  987.     _res = Py_BuildValue("O&",
  988.                          TimeBaseObj_New, _rv);
  989.     return _res;
  990. }
  991.  
  992. static PyObject *TimeBaseObj_GetTimeBaseMasterClock(_self, _args)
  993.     TimeBaseObject *_self;
  994.     PyObject *_args;
  995. {
  996.     PyObject *_res = NULL;
  997.     ComponentInstance _rv;
  998.     if (!PyArg_ParseTuple(_args, ""))
  999.         return NULL;
  1000.     _rv = GetTimeBaseMasterClock(_self->ob_itself);
  1001.     _res = Py_BuildValue("O&",
  1002.                          CmpInstObj_New, _rv);
  1003.     return _res;
  1004. }
  1005.  
  1006. static PyObject *TimeBaseObj_GetTimeBaseEffectiveRate(_self, _args)
  1007.     TimeBaseObject *_self;
  1008.     PyObject *_args;
  1009. {
  1010.     PyObject *_res = NULL;
  1011.     Fixed _rv;
  1012.     if (!PyArg_ParseTuple(_args, ""))
  1013.         return NULL;
  1014.     _rv = GetTimeBaseEffectiveRate(_self->ob_itself);
  1015.     _res = Py_BuildValue("O&",
  1016.                          PyMac_BuildFixed, _rv);
  1017.     return _res;
  1018. }
  1019.  
  1020. static PyMethodDef TimeBaseObj_methods[] = {
  1021.     {"SetTimeBaseValue", (PyCFunction)TimeBaseObj_SetTimeBaseValue, 1,
  1022.      "(TimeValue t, TimeScale s) -> None"},
  1023.     {"GetTimeBaseRate", (PyCFunction)TimeBaseObj_GetTimeBaseRate, 1,
  1024.      "() -> (Fixed _rv)"},
  1025.     {"SetTimeBaseRate", (PyCFunction)TimeBaseObj_SetTimeBaseRate, 1,
  1026.      "(Fixed r) -> None"},
  1027.     {"GetTimeBaseFlags", (PyCFunction)TimeBaseObj_GetTimeBaseFlags, 1,
  1028.      "() -> (long _rv)"},
  1029.     {"SetTimeBaseFlags", (PyCFunction)TimeBaseObj_SetTimeBaseFlags, 1,
  1030.      "(long timeBaseFlags) -> None"},
  1031.     {"GetTimeBaseMasterTimeBase", (PyCFunction)TimeBaseObj_GetTimeBaseMasterTimeBase, 1,
  1032.      "() -> (TimeBase _rv)"},
  1033.     {"GetTimeBaseMasterClock", (PyCFunction)TimeBaseObj_GetTimeBaseMasterClock, 1,
  1034.      "() -> (ComponentInstance _rv)"},
  1035.     {"GetTimeBaseEffectiveRate", (PyCFunction)TimeBaseObj_GetTimeBaseEffectiveRate, 1,
  1036.      "() -> (Fixed _rv)"},
  1037.     {NULL, NULL, 0}
  1038. };
  1039.  
  1040. PyMethodChain TimeBaseObj_chain = { TimeBaseObj_methods, NULL };
  1041.  
  1042. static PyObject *TimeBaseObj_getattr(self, name)
  1043.     TimeBaseObject *self;
  1044.     char *name;
  1045. {
  1046.     return Py_FindMethodInChain(&TimeBaseObj_chain, (PyObject *)self, name);
  1047. }
  1048.  
  1049. #define TimeBaseObj_setattr NULL
  1050.  
  1051. PyTypeObject TimeBase_Type = {
  1052.     PyObject_HEAD_INIT(&PyType_Type)
  1053.     0, /*ob_size*/
  1054.     "TimeBase", /*tp_name*/
  1055.     sizeof(TimeBaseObject), /*tp_basicsize*/
  1056.     0, /*tp_itemsize*/
  1057.     /* methods */
  1058.     (destructor) TimeBaseObj_dealloc, /*tp_dealloc*/
  1059.     0, /*tp_print*/
  1060.     (getattrfunc) TimeBaseObj_getattr, /*tp_getattr*/
  1061.     (setattrfunc) TimeBaseObj_setattr, /*tp_setattr*/
  1062. };
  1063.  
  1064. /* -------------------- End object type TimeBase -------------------- */
  1065.  
  1066.  
  1067. /* ---------------------- Object type UserData ---------------------- */
  1068.  
  1069. PyTypeObject UserData_Type;
  1070.  
  1071. #define UserDataObj_Check(x) ((x)->ob_type == &UserData_Type)
  1072.  
  1073. typedef struct UserDataObject {
  1074.     PyObject_HEAD
  1075.     UserData ob_itself;
  1076. } UserDataObject;
  1077.  
  1078. PyObject *UserDataObj_New(itself)
  1079.     UserData itself;
  1080. {
  1081.     UserDataObject *it;
  1082.     if (itself == NULL) {
  1083.                         PyErr_SetString(Qt_Error,"Cannot create null UserData");
  1084.                         return NULL;
  1085.                     }
  1086.     it = PyObject_NEW(UserDataObject, &UserData_Type);
  1087.     if (it == NULL) return NULL;
  1088.     it->ob_itself = itself;
  1089.     return (PyObject *)it;
  1090. }
  1091. UserDataObj_Convert(v, p_itself)
  1092.     PyObject *v;
  1093.     UserData *p_itself;
  1094. {
  1095.     if (!UserDataObj_Check(v))
  1096.     {
  1097.         PyErr_SetString(PyExc_TypeError, "UserData required");
  1098.         return 0;
  1099.     }
  1100.     *p_itself = ((UserDataObject *)v)->ob_itself;
  1101.     return 1;
  1102. }
  1103.  
  1104. static void UserDataObj_dealloc(self)
  1105.     UserDataObject *self;
  1106. {
  1107.     DisposeUserData(self->ob_itself);
  1108.     PyMem_DEL(self);
  1109. }
  1110.  
  1111. static PyObject *UserDataObj_GetUserData(_self, _args)
  1112.     UserDataObject *_self;
  1113.     PyObject *_args;
  1114. {
  1115.     PyObject *_res = NULL;
  1116.     OSErr _err;
  1117.     Handle data;
  1118.     OSType udType;
  1119.     long index;
  1120.     if (!PyArg_ParseTuple(_args, "O&O&l",
  1121.                           ResObj_Convert, &data,
  1122.                           PyMac_GetOSType, &udType,
  1123.                           &index))
  1124.         return NULL;
  1125.     _err = GetUserData(_self->ob_itself,
  1126.                        data,
  1127.                        udType,
  1128.                        index);
  1129.     if (_err != noErr) return PyMac_Error(_err);
  1130.     Py_INCREF(Py_None);
  1131.     _res = Py_None;
  1132.     return _res;
  1133. }
  1134.  
  1135. static PyObject *UserDataObj_AddUserData(_self, _args)
  1136.     UserDataObject *_self;
  1137.     PyObject *_args;
  1138. {
  1139.     PyObject *_res = NULL;
  1140.     OSErr _err;
  1141.     Handle data;
  1142.     OSType udType;
  1143.     if (!PyArg_ParseTuple(_args, "O&O&",
  1144.                           ResObj_Convert, &data,
  1145.                           PyMac_GetOSType, &udType))
  1146.         return NULL;
  1147.     _err = AddUserData(_self->ob_itself,
  1148.                        data,
  1149.                        udType);
  1150.     if (_err != noErr) return PyMac_Error(_err);
  1151.     Py_INCREF(Py_None);
  1152.     _res = Py_None;
  1153.     return _res;
  1154. }
  1155.  
  1156. static PyObject *UserDataObj_RemoveUserData(_self, _args)
  1157.     UserDataObject *_self;
  1158.     PyObject *_args;
  1159. {
  1160.     PyObject *_res = NULL;
  1161.     OSErr _err;
  1162.     OSType udType;
  1163.     long index;
  1164.     if (!PyArg_ParseTuple(_args, "O&l",
  1165.                           PyMac_GetOSType, &udType,
  1166.                           &index))
  1167.         return NULL;
  1168.     _err = RemoveUserData(_self->ob_itself,
  1169.                           udType,
  1170.                           index);
  1171.     if (_err != noErr) return PyMac_Error(_err);
  1172.     Py_INCREF(Py_None);
  1173.     _res = Py_None;
  1174.     return _res;
  1175. }
  1176.  
  1177. static PyObject *UserDataObj_CountUserDataType(_self, _args)
  1178.     UserDataObject *_self;
  1179.     PyObject *_args;
  1180. {
  1181.     PyObject *_res = NULL;
  1182.     short _rv;
  1183.     OSType udType;
  1184.     if (!PyArg_ParseTuple(_args, "O&",
  1185.                           PyMac_GetOSType, &udType))
  1186.         return NULL;
  1187.     _rv = CountUserDataType(_self->ob_itself,
  1188.                             udType);
  1189.     _res = Py_BuildValue("h",
  1190.                          _rv);
  1191.     return _res;
  1192. }
  1193.  
  1194. static PyObject *UserDataObj_GetNextUserDataType(_self, _args)
  1195.     UserDataObject *_self;
  1196.     PyObject *_args;
  1197. {
  1198.     PyObject *_res = NULL;
  1199.     long _rv;
  1200.     OSType udType;
  1201.     if (!PyArg_ParseTuple(_args, "O&",
  1202.                           PyMac_GetOSType, &udType))
  1203.         return NULL;
  1204.     _rv = GetNextUserDataType(_self->ob_itself,
  1205.                               udType);
  1206.     _res = Py_BuildValue("l",
  1207.                          _rv);
  1208.     return _res;
  1209. }
  1210.  
  1211. static PyObject *UserDataObj_AddUserDataText(_self, _args)
  1212.     UserDataObject *_self;
  1213.     PyObject *_args;
  1214. {
  1215.     PyObject *_res = NULL;
  1216.     OSErr _err;
  1217.     Handle data;
  1218.     OSType udType;
  1219.     long index;
  1220.     short itlRegionTag;
  1221.     if (!PyArg_ParseTuple(_args, "O&O&lh",
  1222.                           ResObj_Convert, &data,
  1223.                           PyMac_GetOSType, &udType,
  1224.                           &index,
  1225.                           &itlRegionTag))
  1226.         return NULL;
  1227.     _err = AddUserDataText(_self->ob_itself,
  1228.                            data,
  1229.                            udType,
  1230.                            index,
  1231.                            itlRegionTag);
  1232.     if (_err != noErr) return PyMac_Error(_err);
  1233.     Py_INCREF(Py_None);
  1234.     _res = Py_None;
  1235.     return _res;
  1236. }
  1237.  
  1238. static PyObject *UserDataObj_GetUserDataText(_self, _args)
  1239.     UserDataObject *_self;
  1240.     PyObject *_args;
  1241. {
  1242.     PyObject *_res = NULL;
  1243.     OSErr _err;
  1244.     Handle data;
  1245.     OSType udType;
  1246.     long index;
  1247.     short itlRegionTag;
  1248.     if (!PyArg_ParseTuple(_args, "O&O&lh",
  1249.                           ResObj_Convert, &data,
  1250.                           PyMac_GetOSType, &udType,
  1251.                           &index,
  1252.                           &itlRegionTag))
  1253.         return NULL;
  1254.     _err = GetUserDataText(_self->ob_itself,
  1255.                            data,
  1256.                            udType,
  1257.                            index,
  1258.                            itlRegionTag);
  1259.     if (_err != noErr) return PyMac_Error(_err);
  1260.     Py_INCREF(Py_None);
  1261.     _res = Py_None;
  1262.     return _res;
  1263. }
  1264.  
  1265. static PyObject *UserDataObj_RemoveUserDataText(_self, _args)
  1266.     UserDataObject *_self;
  1267.     PyObject *_args;
  1268. {
  1269.     PyObject *_res = NULL;
  1270.     OSErr _err;
  1271.     OSType udType;
  1272.     long index;
  1273.     short itlRegionTag;
  1274.     if (!PyArg_ParseTuple(_args, "O&lh",
  1275.                           PyMac_GetOSType, &udType,
  1276.                           &index,
  1277.                           &itlRegionTag))
  1278.         return NULL;
  1279.     _err = RemoveUserDataText(_self->ob_itself,
  1280.                               udType,
  1281.                               index,
  1282.                               itlRegionTag);
  1283.     if (_err != noErr) return PyMac_Error(_err);
  1284.     Py_INCREF(Py_None);
  1285.     _res = Py_None;
  1286.     return _res;
  1287. }
  1288.  
  1289. static PyObject *UserDataObj_PutUserDataIntoHandle(_self, _args)
  1290.     UserDataObject *_self;
  1291.     PyObject *_args;
  1292. {
  1293.     PyObject *_res = NULL;
  1294.     OSErr _err;
  1295.     Handle h;
  1296.     if (!PyArg_ParseTuple(_args, "O&",
  1297.                           ResObj_Convert, &h))
  1298.         return NULL;
  1299.     _err = PutUserDataIntoHandle(_self->ob_itself,
  1300.                                  h);
  1301.     if (_err != noErr) return PyMac_Error(_err);
  1302.     Py_INCREF(Py_None);
  1303.     _res = Py_None;
  1304.     return _res;
  1305. }
  1306.  
  1307. static PyMethodDef UserDataObj_methods[] = {
  1308.     {"GetUserData", (PyCFunction)UserDataObj_GetUserData, 1,
  1309.      "(Handle data, OSType udType, long index) -> None"},
  1310.     {"AddUserData", (PyCFunction)UserDataObj_AddUserData, 1,
  1311.      "(Handle data, OSType udType) -> None"},
  1312.     {"RemoveUserData", (PyCFunction)UserDataObj_RemoveUserData, 1,
  1313.      "(OSType udType, long index) -> None"},
  1314.     {"CountUserDataType", (PyCFunction)UserDataObj_CountUserDataType, 1,
  1315.      "(OSType udType) -> (short _rv)"},
  1316.     {"GetNextUserDataType", (PyCFunction)UserDataObj_GetNextUserDataType, 1,
  1317.      "(OSType udType) -> (long _rv)"},
  1318.     {"AddUserDataText", (PyCFunction)UserDataObj_AddUserDataText, 1,
  1319.      "(Handle data, OSType udType, long index, short itlRegionTag) -> None"},
  1320.     {"GetUserDataText", (PyCFunction)UserDataObj_GetUserDataText, 1,
  1321.      "(Handle data, OSType udType, long index, short itlRegionTag) -> None"},
  1322.     {"RemoveUserDataText", (PyCFunction)UserDataObj_RemoveUserDataText, 1,
  1323.      "(OSType udType, long index, short itlRegionTag) -> None"},
  1324.     {"PutUserDataIntoHandle", (PyCFunction)UserDataObj_PutUserDataIntoHandle, 1,
  1325.      "(Handle h) -> None"},
  1326.     {NULL, NULL, 0}
  1327. };
  1328.  
  1329. PyMethodChain UserDataObj_chain = { UserDataObj_methods, NULL };
  1330.  
  1331. static PyObject *UserDataObj_getattr(self, name)
  1332.     UserDataObject *self;
  1333.     char *name;
  1334. {
  1335.     return Py_FindMethodInChain(&UserDataObj_chain, (PyObject *)self, name);
  1336. }
  1337.  
  1338. #define UserDataObj_setattr NULL
  1339.  
  1340. PyTypeObject UserData_Type = {
  1341.     PyObject_HEAD_INIT(&PyType_Type)
  1342.     0, /*ob_size*/
  1343.     "UserData", /*tp_name*/
  1344.     sizeof(UserDataObject), /*tp_basicsize*/
  1345.     0, /*tp_itemsize*/
  1346.     /* methods */
  1347.     (destructor) UserDataObj_dealloc, /*tp_dealloc*/
  1348.     0, /*tp_print*/
  1349.     (getattrfunc) UserDataObj_getattr, /*tp_getattr*/
  1350.     (setattrfunc) UserDataObj_setattr, /*tp_setattr*/
  1351. };
  1352.  
  1353. /* -------------------- End object type UserData -------------------- */
  1354.  
  1355.  
  1356. /* ----------------------- Object type Media ------------------------ */
  1357.  
  1358. PyTypeObject Media_Type;
  1359.  
  1360. #define MediaObj_Check(x) ((x)->ob_type == &Media_Type)
  1361.  
  1362. typedef struct MediaObject {
  1363.     PyObject_HEAD
  1364.     Media ob_itself;
  1365. } MediaObject;
  1366.  
  1367. PyObject *MediaObj_New(itself)
  1368.     Media itself;
  1369. {
  1370.     MediaObject *it;
  1371.     if (itself == NULL) {
  1372.                         PyErr_SetString(Qt_Error,"Cannot create null Media");
  1373.                         return NULL;
  1374.                     }
  1375.     it = PyObject_NEW(MediaObject, &Media_Type);
  1376.     if (it == NULL) return NULL;
  1377.     it->ob_itself = itself;
  1378.     return (PyObject *)it;
  1379. }
  1380. MediaObj_Convert(v, p_itself)
  1381.     PyObject *v;
  1382.     Media *p_itself;
  1383. {
  1384.     if (!MediaObj_Check(v))
  1385.     {
  1386.         PyErr_SetString(PyExc_TypeError, "Media required");
  1387.         return 0;
  1388.     }
  1389.     *p_itself = ((MediaObject *)v)->ob_itself;
  1390.     return 1;
  1391. }
  1392.  
  1393. static void MediaObj_dealloc(self)
  1394.     MediaObject *self;
  1395. {
  1396.     DisposeTrackMedia(self->ob_itself);
  1397.     PyMem_DEL(self);
  1398. }
  1399.  
  1400. static PyObject *MediaObj_LoadMediaIntoRam(_self, _args)
  1401.     MediaObject *_self;
  1402.     PyObject *_args;
  1403. {
  1404.     PyObject *_res = NULL;
  1405.     OSErr _err;
  1406.     TimeValue time;
  1407.     TimeValue duration;
  1408.     long flags;
  1409.     if (!PyArg_ParseTuple(_args, "lll",
  1410.                           &time,
  1411.                           &duration,
  1412.                           &flags))
  1413.         return NULL;
  1414.     _err = LoadMediaIntoRam(_self->ob_itself,
  1415.                             time,
  1416.                             duration,
  1417.                             flags);
  1418.     if (_err != noErr) return PyMac_Error(_err);
  1419.     Py_INCREF(Py_None);
  1420.     _res = Py_None;
  1421.     return _res;
  1422. }
  1423.  
  1424. static PyObject *MediaObj_GetMediaTrack(_self, _args)
  1425.     MediaObject *_self;
  1426.     PyObject *_args;
  1427. {
  1428.     PyObject *_res = NULL;
  1429.     Track _rv;
  1430.     if (!PyArg_ParseTuple(_args, ""))
  1431.         return NULL;
  1432.     _rv = GetMediaTrack(_self->ob_itself);
  1433.     _res = Py_BuildValue("O&",
  1434.                          TrackObj_New, _rv);
  1435.     return _res;
  1436. }
  1437.  
  1438. static PyObject *MediaObj_GetMediaTimeScale(_self, _args)
  1439.     MediaObject *_self;
  1440.     PyObject *_args;
  1441. {
  1442.     PyObject *_res = NULL;
  1443.     TimeScale _rv;
  1444.     if (!PyArg_ParseTuple(_args, ""))
  1445.         return NULL;
  1446.     _rv = GetMediaTimeScale(_self->ob_itself);
  1447.     _res = Py_BuildValue("l",
  1448.                          _rv);
  1449.     return _res;
  1450. }
  1451.  
  1452. static PyObject *MediaObj_SetMediaTimeScale(_self, _args)
  1453.     MediaObject *_self;
  1454.     PyObject *_args;
  1455. {
  1456.     PyObject *_res = NULL;
  1457.     TimeScale timeScale;
  1458.     if (!PyArg_ParseTuple(_args, "l",
  1459.                           &timeScale))
  1460.         return NULL;
  1461.     SetMediaTimeScale(_self->ob_itself,
  1462.                       timeScale);
  1463.     Py_INCREF(Py_None);
  1464.     _res = Py_None;
  1465.     return _res;
  1466. }
  1467.  
  1468. static PyObject *MediaObj_GetMediaDuration(_self, _args)
  1469.     MediaObject *_self;
  1470.     PyObject *_args;
  1471. {
  1472.     PyObject *_res = NULL;
  1473.     TimeValue _rv;
  1474.     if (!PyArg_ParseTuple(_args, ""))
  1475.         return NULL;
  1476.     _rv = GetMediaDuration(_self->ob_itself);
  1477.     _res = Py_BuildValue("l",
  1478.                          _rv);
  1479.     return _res;
  1480. }
  1481.  
  1482. static PyObject *MediaObj_GetMediaLanguage(_self, _args)
  1483.     MediaObject *_self;
  1484.     PyObject *_args;
  1485. {
  1486.     PyObject *_res = NULL;
  1487.     short _rv;
  1488.     if (!PyArg_ParseTuple(_args, ""))
  1489.         return NULL;
  1490.     _rv = GetMediaLanguage(_self->ob_itself);
  1491.     _res = Py_BuildValue("h",
  1492.                          _rv);
  1493.     return _res;
  1494. }
  1495.  
  1496. static PyObject *MediaObj_SetMediaLanguage(_self, _args)
  1497.     MediaObject *_self;
  1498.     PyObject *_args;
  1499. {
  1500.     PyObject *_res = NULL;
  1501.     short language;
  1502.     if (!PyArg_ParseTuple(_args, "h",
  1503.                           &language))
  1504.         return NULL;
  1505.     SetMediaLanguage(_self->ob_itself,
  1506.                      language);
  1507.     Py_INCREF(Py_None);
  1508.     _res = Py_None;
  1509.     return _res;
  1510. }
  1511.  
  1512. static PyObject *MediaObj_GetMediaQuality(_self, _args)
  1513.     MediaObject *_self;
  1514.     PyObject *_args;
  1515. {
  1516.     PyObject *_res = NULL;
  1517.     short _rv;
  1518.     if (!PyArg_ParseTuple(_args, ""))
  1519.         return NULL;
  1520.     _rv = GetMediaQuality(_self->ob_itself);
  1521.     _res = Py_BuildValue("h",
  1522.                          _rv);
  1523.     return _res;
  1524. }
  1525.  
  1526. static PyObject *MediaObj_SetMediaQuality(_self, _args)
  1527.     MediaObject *_self;
  1528.     PyObject *_args;
  1529. {
  1530.     PyObject *_res = NULL;
  1531.     short quality;
  1532.     if (!PyArg_ParseTuple(_args, "h",
  1533.                           &quality))
  1534.         return NULL;
  1535.     SetMediaQuality(_self->ob_itself,
  1536.                     quality);
  1537.     Py_INCREF(Py_None);
  1538.     _res = Py_None;
  1539.     return _res;
  1540. }
  1541.  
  1542. static PyObject *MediaObj_GetMediaHandlerDescription(_self, _args)
  1543.     MediaObject *_self;
  1544.     PyObject *_args;
  1545. {
  1546.     PyObject *_res = NULL;
  1547.     OSType mediaType;
  1548.     Str255 creatorName;
  1549.     OSType creatorManufacturer;
  1550.     if (!PyArg_ParseTuple(_args, "O&",
  1551.                           PyMac_GetStr255, creatorName))
  1552.         return NULL;
  1553.     GetMediaHandlerDescription(_self->ob_itself,
  1554.                                &mediaType,
  1555.                                creatorName,
  1556.                                &creatorManufacturer);
  1557.     _res = Py_BuildValue("O&O&",
  1558.                          PyMac_BuildOSType, mediaType,
  1559.                          PyMac_BuildOSType, creatorManufacturer);
  1560.     return _res;
  1561. }
  1562.  
  1563. static PyObject *MediaObj_GetMediaUserData(_self, _args)
  1564.     MediaObject *_self;
  1565.     PyObject *_args;
  1566. {
  1567.     PyObject *_res = NULL;
  1568.     UserData _rv;
  1569.     if (!PyArg_ParseTuple(_args, ""))
  1570.         return NULL;
  1571.     _rv = GetMediaUserData(_self->ob_itself);
  1572.     _res = Py_BuildValue("O&",
  1573.                          UserDataObj_New, _rv);
  1574.     return _res;
  1575. }
  1576.  
  1577. static PyObject *MediaObj_GetMediaHandler(_self, _args)
  1578.     MediaObject *_self;
  1579.     PyObject *_args;
  1580. {
  1581.     PyObject *_res = NULL;
  1582.     MediaHandler _rv;
  1583.     if (!PyArg_ParseTuple(_args, ""))
  1584.         return NULL;
  1585.     _rv = GetMediaHandler(_self->ob_itself);
  1586.     _res = Py_BuildValue("O&",
  1587.                          CmpInstObj_New, _rv);
  1588.     return _res;
  1589. }
  1590.  
  1591. static PyObject *MediaObj_SetMediaHandler(_self, _args)
  1592.     MediaObject *_self;
  1593.     PyObject *_args;
  1594. {
  1595.     PyObject *_res = NULL;
  1596.     OSErr _err;
  1597.     MediaHandlerComponent mH;
  1598.     if (!PyArg_ParseTuple(_args, "O&",
  1599.                           CmpObj_Convert, &mH))
  1600.         return NULL;
  1601.     _err = SetMediaHandler(_self->ob_itself,
  1602.                            mH);
  1603.     if (_err != noErr) return PyMac_Error(_err);
  1604.     Py_INCREF(Py_None);
  1605.     _res = Py_None;
  1606.     return _res;
  1607. }
  1608.  
  1609. static PyObject *MediaObj_BeginMediaEdits(_self, _args)
  1610.     MediaObject *_self;
  1611.     PyObject *_args;
  1612. {
  1613.     PyObject *_res = NULL;
  1614.     OSErr _err;
  1615.     if (!PyArg_ParseTuple(_args, ""))
  1616.         return NULL;
  1617.     _err = BeginMediaEdits(_self->ob_itself);
  1618.     if (_err != noErr) return PyMac_Error(_err);
  1619.     Py_INCREF(Py_None);
  1620.     _res = Py_None;
  1621.     return _res;
  1622. }
  1623.  
  1624. static PyObject *MediaObj_EndMediaEdits(_self, _args)
  1625.     MediaObject *_self;
  1626.     PyObject *_args;
  1627. {
  1628.     PyObject *_res = NULL;
  1629.     OSErr _err;
  1630.     if (!PyArg_ParseTuple(_args, ""))
  1631.         return NULL;
  1632.     _err = EndMediaEdits(_self->ob_itself);
  1633.     if (_err != noErr) return PyMac_Error(_err);
  1634.     Py_INCREF(Py_None);
  1635.     _res = Py_None;
  1636.     return _res;
  1637. }
  1638.  
  1639. static PyObject *MediaObj_SetMediaDefaultDataRefIndex(_self, _args)
  1640.     MediaObject *_self;
  1641.     PyObject *_args;
  1642. {
  1643.     PyObject *_res = NULL;
  1644.     OSErr _err;
  1645.     short index;
  1646.     if (!PyArg_ParseTuple(_args, "h",
  1647.                           &index))
  1648.         return NULL;
  1649.     _err = SetMediaDefaultDataRefIndex(_self->ob_itself,
  1650.                                        index);
  1651.     if (_err != noErr) return PyMac_Error(_err);
  1652.     Py_INCREF(Py_None);
  1653.     _res = Py_None;
  1654.     return _res;
  1655. }
  1656.  
  1657. static PyObject *MediaObj_GetMediaDataHandlerDescription(_self, _args)
  1658.     MediaObject *_self;
  1659.     PyObject *_args;
  1660. {
  1661.     PyObject *_res = NULL;
  1662.     short index;
  1663.     OSType dhType;
  1664.     Str255 creatorName;
  1665.     OSType creatorManufacturer;
  1666.     if (!PyArg_ParseTuple(_args, "hO&",
  1667.                           &index,
  1668.                           PyMac_GetStr255, creatorName))
  1669.         return NULL;
  1670.     GetMediaDataHandlerDescription(_self->ob_itself,
  1671.                                    index,
  1672.                                    &dhType,
  1673.                                    creatorName,
  1674.                                    &creatorManufacturer);
  1675.     _res = Py_BuildValue("O&O&",
  1676.                          PyMac_BuildOSType, dhType,
  1677.                          PyMac_BuildOSType, creatorManufacturer);
  1678.     return _res;
  1679. }
  1680.  
  1681. static PyObject *MediaObj_GetMediaDataHandler(_self, _args)
  1682.     MediaObject *_self;
  1683.     PyObject *_args;
  1684. {
  1685.     PyObject *_res = NULL;
  1686.     DataHandler _rv;
  1687.     short index;
  1688.     if (!PyArg_ParseTuple(_args, "h",
  1689.                           &index))
  1690.         return NULL;
  1691.     _rv = GetMediaDataHandler(_self->ob_itself,
  1692.                               index);
  1693.     _res = Py_BuildValue("O&",
  1694.                          CmpInstObj_New, _rv);
  1695.     return _res;
  1696. }
  1697.  
  1698. static PyObject *MediaObj_SetMediaDataHandler(_self, _args)
  1699.     MediaObject *_self;
  1700.     PyObject *_args;
  1701. {
  1702.     PyObject *_res = NULL;
  1703.     OSErr _err;
  1704.     short index;
  1705.     DataHandlerComponent dataHandler;
  1706.     if (!PyArg_ParseTuple(_args, "hO&",
  1707.                           &index,
  1708.                           CmpObj_Convert, &dataHandler))
  1709.         return NULL;
  1710.     _err = SetMediaDataHandler(_self->ob_itself,
  1711.                                index,
  1712.                                dataHandler);
  1713.     if (_err != noErr) return PyMac_Error(_err);
  1714.     Py_INCREF(Py_None);
  1715.     _res = Py_None;
  1716.     return _res;
  1717. }
  1718.  
  1719. static PyObject *MediaObj_GetMediaSampleDescriptionCount(_self, _args)
  1720.     MediaObject *_self;
  1721.     PyObject *_args;
  1722. {
  1723.     PyObject *_res = NULL;
  1724.     long _rv;
  1725.     if (!PyArg_ParseTuple(_args, ""))
  1726.         return NULL;
  1727.     _rv = GetMediaSampleDescriptionCount(_self->ob_itself);
  1728.     _res = Py_BuildValue("l",
  1729.                          _rv);
  1730.     return _res;
  1731. }
  1732.  
  1733. static PyObject *MediaObj_GetMediaSampleDescription(_self, _args)
  1734.     MediaObject *_self;
  1735.     PyObject *_args;
  1736. {
  1737.     PyObject *_res = NULL;
  1738.     long index;
  1739.     SampleDescriptionHandle descH;
  1740.     if (!PyArg_ParseTuple(_args, "lO&",
  1741.                           &index,
  1742.                           ResObj_Convert, &descH))
  1743.         return NULL;
  1744.     GetMediaSampleDescription(_self->ob_itself,
  1745.                               index,
  1746.                               descH);
  1747.     Py_INCREF(Py_None);
  1748.     _res = Py_None;
  1749.     return _res;
  1750. }
  1751.  
  1752. static PyObject *MediaObj_SetMediaSampleDescription(_self, _args)
  1753.     MediaObject *_self;
  1754.     PyObject *_args;
  1755. {
  1756.     PyObject *_res = NULL;
  1757.     OSErr _err;
  1758.     long index;
  1759.     SampleDescriptionHandle descH;
  1760.     if (!PyArg_ParseTuple(_args, "lO&",
  1761.                           &index,
  1762.                           ResObj_Convert, &descH))
  1763.         return NULL;
  1764.     _err = SetMediaSampleDescription(_self->ob_itself,
  1765.                                      index,
  1766.                                      descH);
  1767.     if (_err != noErr) return PyMac_Error(_err);
  1768.     Py_INCREF(Py_None);
  1769.     _res = Py_None;
  1770.     return _res;
  1771. }
  1772.  
  1773. static PyObject *MediaObj_GetMediaSampleCount(_self, _args)
  1774.     MediaObject *_self;
  1775.     PyObject *_args;
  1776. {
  1777.     PyObject *_res = NULL;
  1778.     long _rv;
  1779.     if (!PyArg_ParseTuple(_args, ""))
  1780.         return NULL;
  1781.     _rv = GetMediaSampleCount(_self->ob_itself);
  1782.     _res = Py_BuildValue("l",
  1783.                          _rv);
  1784.     return _res;
  1785. }
  1786.  
  1787. static PyObject *MediaObj_SampleNumToMediaTime(_self, _args)
  1788.     MediaObject *_self;
  1789.     PyObject *_args;
  1790. {
  1791.     PyObject *_res = NULL;
  1792.     long logicalSampleNum;
  1793.     TimeValue sampleTime;
  1794.     TimeValue sampleDuration;
  1795.     if (!PyArg_ParseTuple(_args, "l",
  1796.                           &logicalSampleNum))
  1797.         return NULL;
  1798.     SampleNumToMediaTime(_self->ob_itself,
  1799.                          logicalSampleNum,
  1800.                          &sampleTime,
  1801.                          &sampleDuration);
  1802.     _res = Py_BuildValue("ll",
  1803.                          sampleTime,
  1804.                          sampleDuration);
  1805.     return _res;
  1806. }
  1807.  
  1808. static PyObject *MediaObj_MediaTimeToSampleNum(_self, _args)
  1809.     MediaObject *_self;
  1810.     PyObject *_args;
  1811. {
  1812.     PyObject *_res = NULL;
  1813.     TimeValue time;
  1814.     long sampleNum;
  1815.     TimeValue sampleTime;
  1816.     TimeValue sampleDuration;
  1817.     if (!PyArg_ParseTuple(_args, "l",
  1818.                           &time))
  1819.         return NULL;
  1820.     MediaTimeToSampleNum(_self->ob_itself,
  1821.                          time,
  1822.                          &sampleNum,
  1823.                          &sampleTime,
  1824.                          &sampleDuration);
  1825.     _res = Py_BuildValue("lll",
  1826.                          sampleNum,
  1827.                          sampleTime,
  1828.                          sampleDuration);
  1829.     return _res;
  1830. }
  1831.  
  1832. static PyObject *MediaObj_AddMediaSample(_self, _args)
  1833.     MediaObject *_self;
  1834.     PyObject *_args;
  1835. {
  1836.     PyObject *_res = NULL;
  1837.     OSErr _err;
  1838.     Handle dataIn;
  1839.     long inOffset;
  1840.     unsigned long size;
  1841.     TimeValue durationPerSample;
  1842.     SampleDescriptionHandle sampleDescriptionH;
  1843.     long numberOfSamples;
  1844.     short sampleFlags;
  1845.     TimeValue sampleTime;
  1846.     if (!PyArg_ParseTuple(_args, "O&lllO&lh",
  1847.                           ResObj_Convert, &dataIn,
  1848.                           &inOffset,
  1849.                           &size,
  1850.                           &durationPerSample,
  1851.                           ResObj_Convert, &sampleDescriptionH,
  1852.                           &numberOfSamples,
  1853.                           &sampleFlags))
  1854.         return NULL;
  1855.     _err = AddMediaSample(_self->ob_itself,
  1856.                           dataIn,
  1857.                           inOffset,
  1858.                           size,
  1859.                           durationPerSample,
  1860.                           sampleDescriptionH,
  1861.                           numberOfSamples,
  1862.                           sampleFlags,
  1863.                           &sampleTime);
  1864.     if (_err != noErr) return PyMac_Error(_err);
  1865.     _res = Py_BuildValue("l",
  1866.                          sampleTime);
  1867.     return _res;
  1868. }
  1869.  
  1870. static PyObject *MediaObj_AddMediaSampleReference(_self, _args)
  1871.     MediaObject *_self;
  1872.     PyObject *_args;
  1873. {
  1874.     PyObject *_res = NULL;
  1875.     OSErr _err;
  1876.     long dataOffset;
  1877.     unsigned long size;
  1878.     TimeValue durationPerSample;
  1879.     SampleDescriptionHandle sampleDescriptionH;
  1880.     long numberOfSamples;
  1881.     short sampleFlags;
  1882.     TimeValue sampleTime;
  1883.     if (!PyArg_ParseTuple(_args, "lllO&lh",
  1884.                           &dataOffset,
  1885.                           &size,
  1886.                           &durationPerSample,
  1887.                           ResObj_Convert, &sampleDescriptionH,
  1888.                           &numberOfSamples,
  1889.                           &sampleFlags))
  1890.         return NULL;
  1891.     _err = AddMediaSampleReference(_self->ob_itself,
  1892.                                    dataOffset,
  1893.                                    size,
  1894.                                    durationPerSample,
  1895.                                    sampleDescriptionH,
  1896.                                    numberOfSamples,
  1897.                                    sampleFlags,
  1898.                                    &sampleTime);
  1899.     if (_err != noErr) return PyMac_Error(_err);
  1900.     _res = Py_BuildValue("l",
  1901.                          sampleTime);
  1902.     return _res;
  1903. }
  1904.  
  1905. static PyObject *MediaObj_GetMediaSample(_self, _args)
  1906.     MediaObject *_self;
  1907.     PyObject *_args;
  1908. {
  1909.     PyObject *_res = NULL;
  1910.     OSErr _err;
  1911.     Handle dataOut;
  1912.     long maxSizeToGrow;
  1913.     long size;
  1914.     TimeValue time;
  1915.     TimeValue sampleTime;
  1916.     TimeValue durationPerSample;
  1917.     SampleDescriptionHandle sampleDescriptionH;
  1918.     long sampleDescriptionIndex;
  1919.     long maxNumberOfSamples;
  1920.     long numberOfSamples;
  1921.     short sampleFlags;
  1922.     if (!PyArg_ParseTuple(_args, "O&llO&l",
  1923.                           ResObj_Convert, &dataOut,
  1924.                           &maxSizeToGrow,
  1925.                           &time,
  1926.                           ResObj_Convert, &sampleDescriptionH,
  1927.                           &maxNumberOfSamples))
  1928.         return NULL;
  1929.     _err = GetMediaSample(_self->ob_itself,
  1930.                           dataOut,
  1931.                           maxSizeToGrow,
  1932.                           &size,
  1933.                           time,
  1934.                           &sampleTime,
  1935.                           &durationPerSample,
  1936.                           sampleDescriptionH,
  1937.                           &sampleDescriptionIndex,
  1938.                           maxNumberOfSamples,
  1939.                           &numberOfSamples,
  1940.                           &sampleFlags);
  1941.     if (_err != noErr) return PyMac_Error(_err);
  1942.     _res = Py_BuildValue("lllllh",
  1943.                          size,
  1944.                          sampleTime,
  1945.                          durationPerSample,
  1946.                          sampleDescriptionIndex,
  1947.                          numberOfSamples,
  1948.                          sampleFlags);
  1949.     return _res;
  1950. }
  1951.  
  1952. static PyObject *MediaObj_GetMediaSampleReference(_self, _args)
  1953.     MediaObject *_self;
  1954.     PyObject *_args;
  1955. {
  1956.     PyObject *_res = NULL;
  1957.     OSErr _err;
  1958.     long dataOffset;
  1959.     long size;
  1960.     TimeValue time;
  1961.     TimeValue sampleTime;
  1962.     TimeValue durationPerSample;
  1963.     SampleDescriptionHandle sampleDescriptionH;
  1964.     long sampleDescriptionIndex;
  1965.     long maxNumberOfSamples;
  1966.     long numberOfSamples;
  1967.     short sampleFlags;
  1968.     if (!PyArg_ParseTuple(_args, "lO&l",
  1969.                           &time,
  1970.                           ResObj_Convert, &sampleDescriptionH,
  1971.                           &maxNumberOfSamples))
  1972.         return NULL;
  1973.     _err = GetMediaSampleReference(_self->ob_itself,
  1974.                                    &dataOffset,
  1975.                                    &size,
  1976.                                    time,
  1977.                                    &sampleTime,
  1978.                                    &durationPerSample,
  1979.                                    sampleDescriptionH,
  1980.                                    &sampleDescriptionIndex,
  1981.                                    maxNumberOfSamples,
  1982.                                    &numberOfSamples,
  1983.                                    &sampleFlags);
  1984.     if (_err != noErr) return PyMac_Error(_err);
  1985.     _res = Py_BuildValue("llllllh",
  1986.                          dataOffset,
  1987.                          size,
  1988.                          sampleTime,
  1989.                          durationPerSample,
  1990.                          sampleDescriptionIndex,
  1991.                          numberOfSamples,
  1992.                          sampleFlags);
  1993.     return _res;
  1994. }
  1995.  
  1996. static PyObject *MediaObj_SetMediaPreferredChunkSize(_self, _args)
  1997.     MediaObject *_self;
  1998.     PyObject *_args;
  1999. {
  2000.     PyObject *_res = NULL;
  2001.     OSErr _err;
  2002.     long maxChunkSize;
  2003.     if (!PyArg_ParseTuple(_args, "l",
  2004.                           &maxChunkSize))
  2005.         return NULL;
  2006.     _err = SetMediaPreferredChunkSize(_self->ob_itself,
  2007.                                       maxChunkSize);
  2008.     if (_err != noErr) return PyMac_Error(_err);
  2009.     Py_INCREF(Py_None);
  2010.     _res = Py_None;
  2011.     return _res;
  2012. }
  2013.  
  2014. static PyObject *MediaObj_GetMediaPreferredChunkSize(_self, _args)
  2015.     MediaObject *_self;
  2016.     PyObject *_args;
  2017. {
  2018.     PyObject *_res = NULL;
  2019.     OSErr _err;
  2020.     long maxChunkSize;
  2021.     if (!PyArg_ParseTuple(_args, ""))
  2022.         return NULL;
  2023.     _err = GetMediaPreferredChunkSize(_self->ob_itself,
  2024.                                       &maxChunkSize);
  2025.     if (_err != noErr) return PyMac_Error(_err);
  2026.     _res = Py_BuildValue("l",
  2027.                          maxChunkSize);
  2028.     return _res;
  2029. }
  2030.  
  2031. static PyObject *MediaObj_SetMediaShadowSync(_self, _args)
  2032.     MediaObject *_self;
  2033.     PyObject *_args;
  2034. {
  2035.     PyObject *_res = NULL;
  2036.     OSErr _err;
  2037.     long frameDiffSampleNum;
  2038.     long syncSampleNum;
  2039.     if (!PyArg_ParseTuple(_args, "ll",
  2040.                           &frameDiffSampleNum,
  2041.                           &syncSampleNum))
  2042.         return NULL;
  2043.     _err = SetMediaShadowSync(_self->ob_itself,
  2044.                               frameDiffSampleNum,
  2045.                               syncSampleNum);
  2046.     if (_err != noErr) return PyMac_Error(_err);
  2047.     Py_INCREF(Py_None);
  2048.     _res = Py_None;
  2049.     return _res;
  2050. }
  2051.  
  2052. static PyObject *MediaObj_GetMediaShadowSync(_self, _args)
  2053.     MediaObject *_self;
  2054.     PyObject *_args;
  2055. {
  2056.     PyObject *_res = NULL;
  2057.     OSErr _err;
  2058.     long frameDiffSampleNum;
  2059.     long syncSampleNum;
  2060.     if (!PyArg_ParseTuple(_args, "l",
  2061.                           &frameDiffSampleNum))
  2062.         return NULL;
  2063.     _err = GetMediaShadowSync(_self->ob_itself,
  2064.                               frameDiffSampleNum,
  2065.                               &syncSampleNum);
  2066.     if (_err != noErr) return PyMac_Error(_err);
  2067.     _res = Py_BuildValue("l",
  2068.                          syncSampleNum);
  2069.     return _res;
  2070. }
  2071.  
  2072. static PyObject *MediaObj_GetMediaDataSize(_self, _args)
  2073.     MediaObject *_self;
  2074.     PyObject *_args;
  2075. {
  2076.     PyObject *_res = NULL;
  2077.     long _rv;
  2078.     TimeValue startTime;
  2079.     TimeValue duration;
  2080.     if (!PyArg_ParseTuple(_args, "ll",
  2081.                           &startTime,
  2082.                           &duration))
  2083.         return NULL;
  2084.     _rv = GetMediaDataSize(_self->ob_itself,
  2085.                            startTime,
  2086.                            duration);
  2087.     _res = Py_BuildValue("l",
  2088.                          _rv);
  2089.     return _res;
  2090. }
  2091.  
  2092. static PyObject *MediaObj_GetMediaNextInterestingTime(_self, _args)
  2093.     MediaObject *_self;
  2094.     PyObject *_args;
  2095. {
  2096.     PyObject *_res = NULL;
  2097.     short interestingTimeFlags;
  2098.     TimeValue time;
  2099.     Fixed rate;
  2100.     TimeValue interestingTime;
  2101.     TimeValue interestingDuration;
  2102.     if (!PyArg_ParseTuple(_args, "hlO&",
  2103.                           &interestingTimeFlags,
  2104.                           &time,
  2105.                           PyMac_GetFixed, &rate))
  2106.         return NULL;
  2107.     GetMediaNextInterestingTime(_self->ob_itself,
  2108.                                 interestingTimeFlags,
  2109.                                 time,
  2110.                                 rate,
  2111.                                 &interestingTime,
  2112.                                 &interestingDuration);
  2113.     _res = Py_BuildValue("ll",
  2114.                          interestingTime,
  2115.                          interestingDuration);
  2116.     return _res;
  2117. }
  2118.  
  2119. static PyObject *MediaObj_GetMediaDataRef(_self, _args)
  2120.     MediaObject *_self;
  2121.     PyObject *_args;
  2122. {
  2123.     PyObject *_res = NULL;
  2124.     OSErr _err;
  2125.     short index;
  2126.     Handle dataRef;
  2127.     OSType dataRefType;
  2128.     long dataRefAttributes;
  2129.     if (!PyArg_ParseTuple(_args, "h",
  2130.                           &index))
  2131.         return NULL;
  2132.     _err = GetMediaDataRef(_self->ob_itself,
  2133.                            index,
  2134.                            &dataRef,
  2135.                            &dataRefType,
  2136.                            &dataRefAttributes);
  2137.     if (_err != noErr) return PyMac_Error(_err);
  2138.     _res = Py_BuildValue("O&O&l",
  2139.                          ResObj_New, dataRef,
  2140.                          PyMac_BuildOSType, dataRefType,
  2141.                          dataRefAttributes);
  2142.     return _res;
  2143. }
  2144.  
  2145. static PyObject *MediaObj_SetMediaDataRef(_self, _args)
  2146.     MediaObject *_self;
  2147.     PyObject *_args;
  2148. {
  2149.     PyObject *_res = NULL;
  2150.     OSErr _err;
  2151.     short index;
  2152.     Handle dataRef;
  2153.     OSType dataRefType;
  2154.     if (!PyArg_ParseTuple(_args, "hO&O&",
  2155.                           &index,
  2156.                           ResObj_Convert, &dataRef,
  2157.                           PyMac_GetOSType, &dataRefType))
  2158.         return NULL;
  2159.     _err = SetMediaDataRef(_self->ob_itself,
  2160.                            index,
  2161.                            dataRef,
  2162.                            dataRefType);
  2163.     if (_err != noErr) return PyMac_Error(_err);
  2164.     Py_INCREF(Py_None);
  2165.     _res = Py_None;
  2166.     return _res;
  2167. }
  2168.  
  2169. static PyObject *MediaObj_SetMediaDataRefAttributes(_self, _args)
  2170.     MediaObject *_self;
  2171.     PyObject *_args;
  2172. {
  2173.     PyObject *_res = NULL;
  2174.     OSErr _err;
  2175.     short index;
  2176.     long dataRefAttributes;
  2177.     if (!PyArg_ParseTuple(_args, "hl",
  2178.                           &index,
  2179.                           &dataRefAttributes))
  2180.         return NULL;
  2181.     _err = SetMediaDataRefAttributes(_self->ob_itself,
  2182.                                      index,
  2183.                                      dataRefAttributes);
  2184.     if (_err != noErr) return PyMac_Error(_err);
  2185.     Py_INCREF(Py_None);
  2186.     _res = Py_None;
  2187.     return _res;
  2188. }
  2189.  
  2190. static PyObject *MediaObj_AddMediaDataRef(_self, _args)
  2191.     MediaObject *_self;
  2192.     PyObject *_args;
  2193. {
  2194.     PyObject *_res = NULL;
  2195.     OSErr _err;
  2196.     short index;
  2197.     Handle dataRef;
  2198.     OSType dataRefType;
  2199.     if (!PyArg_ParseTuple(_args, "O&O&",
  2200.                           ResObj_Convert, &dataRef,
  2201.                           PyMac_GetOSType, &dataRefType))
  2202.         return NULL;
  2203.     _err = AddMediaDataRef(_self->ob_itself,
  2204.                            &index,
  2205.                            dataRef,
  2206.                            dataRefType);
  2207.     if (_err != noErr) return PyMac_Error(_err);
  2208.     _res = Py_BuildValue("h",
  2209.                          index);
  2210.     return _res;
  2211. }
  2212.  
  2213. static PyObject *MediaObj_GetMediaDataRefCount(_self, _args)
  2214.     MediaObject *_self;
  2215.     PyObject *_args;
  2216. {
  2217.     PyObject *_res = NULL;
  2218.     OSErr _err;
  2219.     short count;
  2220.     if (!PyArg_ParseTuple(_args, ""))
  2221.         return NULL;
  2222.     _err = GetMediaDataRefCount(_self->ob_itself,
  2223.                                 &count);
  2224.     if (_err != noErr) return PyMac_Error(_err);
  2225.     _res = Py_BuildValue("h",
  2226.                          count);
  2227.     return _res;
  2228. }
  2229.  
  2230. static PyObject *MediaObj_SetMediaPlayHints(_self, _args)
  2231.     MediaObject *_self;
  2232.     PyObject *_args;
  2233. {
  2234.     PyObject *_res = NULL;
  2235.     long flags;
  2236.     long flagsMask;
  2237.     if (!PyArg_ParseTuple(_args, "ll",
  2238.                           &flags,
  2239.                           &flagsMask))
  2240.         return NULL;
  2241.     SetMediaPlayHints(_self->ob_itself,
  2242.                       flags,
  2243.                       flagsMask);
  2244.     Py_INCREF(Py_None);
  2245.     _res = Py_None;
  2246.     return _res;
  2247. }
  2248.  
  2249. static PyMethodDef MediaObj_methods[] = {
  2250.     {"LoadMediaIntoRam", (PyCFunction)MediaObj_LoadMediaIntoRam, 1,
  2251.      "(TimeValue time, TimeValue duration, long flags) -> None"},
  2252.     {"GetMediaTrack", (PyCFunction)MediaObj_GetMediaTrack, 1,
  2253.      "() -> (Track _rv)"},
  2254.     {"GetMediaTimeScale", (PyCFunction)MediaObj_GetMediaTimeScale, 1,
  2255.      "() -> (TimeScale _rv)"},
  2256.     {"SetMediaTimeScale", (PyCFunction)MediaObj_SetMediaTimeScale, 1,
  2257.      "(TimeScale timeScale) -> None"},
  2258.     {"GetMediaDuration", (PyCFunction)MediaObj_GetMediaDuration, 1,
  2259.      "() -> (TimeValue _rv)"},
  2260.     {"GetMediaLanguage", (PyCFunction)MediaObj_GetMediaLanguage, 1,
  2261.      "() -> (short _rv)"},
  2262.     {"SetMediaLanguage", (PyCFunction)MediaObj_SetMediaLanguage, 1,
  2263.      "(short language) -> None"},
  2264.     {"GetMediaQuality", (PyCFunction)MediaObj_GetMediaQuality, 1,
  2265.      "() -> (short _rv)"},
  2266.     {"SetMediaQuality", (PyCFunction)MediaObj_SetMediaQuality, 1,
  2267.      "(short quality) -> None"},
  2268.     {"GetMediaHandlerDescription", (PyCFunction)MediaObj_GetMediaHandlerDescription, 1,
  2269.      "(Str255 creatorName) -> (OSType mediaType, OSType creatorManufacturer)"},
  2270.     {"GetMediaUserData", (PyCFunction)MediaObj_GetMediaUserData, 1,
  2271.      "() -> (UserData _rv)"},
  2272.     {"GetMediaHandler", (PyCFunction)MediaObj_GetMediaHandler, 1,
  2273.      "() -> (MediaHandler _rv)"},
  2274.     {"SetMediaHandler", (PyCFunction)MediaObj_SetMediaHandler, 1,
  2275.      "(MediaHandlerComponent mH) -> None"},
  2276.     {"BeginMediaEdits", (PyCFunction)MediaObj_BeginMediaEdits, 1,
  2277.      "() -> None"},
  2278.     {"EndMediaEdits", (PyCFunction)MediaObj_EndMediaEdits, 1,
  2279.      "() -> None"},
  2280.     {"SetMediaDefaultDataRefIndex", (PyCFunction)MediaObj_SetMediaDefaultDataRefIndex, 1,
  2281.      "(short index) -> None"},
  2282.     {"GetMediaDataHandlerDescription", (PyCFunction)MediaObj_GetMediaDataHandlerDescription, 1,
  2283.      "(short index, Str255 creatorName) -> (OSType dhType, OSType creatorManufacturer)"},
  2284.     {"GetMediaDataHandler", (PyCFunction)MediaObj_GetMediaDataHandler, 1,
  2285.      "(short index) -> (DataHandler _rv)"},
  2286.     {"SetMediaDataHandler", (PyCFunction)MediaObj_SetMediaDataHandler, 1,
  2287.      "(short index, DataHandlerComponent dataHandler) -> None"},
  2288.     {"GetMediaSampleDescriptionCount", (PyCFunction)MediaObj_GetMediaSampleDescriptionCount, 1,
  2289.      "() -> (long _rv)"},
  2290.     {"GetMediaSampleDescription", (PyCFunction)MediaObj_GetMediaSampleDescription, 1,
  2291.      "(long index, SampleDescriptionHandle descH) -> None"},
  2292.     {"SetMediaSampleDescription", (PyCFunction)MediaObj_SetMediaSampleDescription, 1,
  2293.      "(long index, SampleDescriptionHandle descH) -> None"},
  2294.     {"GetMediaSampleCount", (PyCFunction)MediaObj_GetMediaSampleCount, 1,
  2295.      "() -> (long _rv)"},
  2296.     {"SampleNumToMediaTime", (PyCFunction)MediaObj_SampleNumToMediaTime, 1,
  2297.      "(long logicalSampleNum) -> (TimeValue sampleTime, TimeValue sampleDuration)"},
  2298.     {"MediaTimeToSampleNum", (PyCFunction)MediaObj_MediaTimeToSampleNum, 1,
  2299.      "(TimeValue time) -> (long sampleNum, TimeValue sampleTime, TimeValue sampleDuration)"},
  2300.     {"AddMediaSample", (PyCFunction)MediaObj_AddMediaSample, 1,
  2301.      "(Handle dataIn, long inOffset, unsigned long size, TimeValue durationPerSample, SampleDescriptionHandle sampleDescriptionH, long numberOfSamples, short sampleFlags) -> (TimeValue sampleTime)"},
  2302.     {"AddMediaSampleReference", (PyCFunction)MediaObj_AddMediaSampleReference, 1,
  2303.      "(long dataOffset, unsigned long size, TimeValue durationPerSample, SampleDescriptionHandle sampleDescriptionH, long numberOfSamples, short sampleFlags) -> (TimeValue sampleTime)"},
  2304.     {"GetMediaSample", (PyCFunction)MediaObj_GetMediaSample, 1,
  2305.      "(Handle dataOut, long maxSizeToGrow, TimeValue time, SampleDescriptionHandle sampleDescriptionH, long maxNumberOfSamples) -> (long size, TimeValue sampleTime, TimeValue durationPerSample, long sampleDescriptionIndex, long numberOfSamples, short sampleFlags)"},
  2306.     {"GetMediaSampleReference", (PyCFunction)MediaObj_GetMediaSampleReference, 1,
  2307.      "(TimeValue time, SampleDescriptionHandle sampleDescriptionH, long maxNumberOfSamples) -> (long dataOffset, long size, TimeValue sampleTime, TimeValue durationPerSample, long sampleDescriptionIndex, long numberOfSamples, short sampleFlags)"},
  2308.     {"SetMediaPreferredChunkSize", (PyCFunction)MediaObj_SetMediaPreferredChunkSize, 1,
  2309.      "(long maxChunkSize) -> None"},
  2310.     {"GetMediaPreferredChunkSize", (PyCFunction)MediaObj_GetMediaPreferredChunkSize, 1,
  2311.      "() -> (long maxChunkSize)"},
  2312.     {"SetMediaShadowSync", (PyCFunction)MediaObj_SetMediaShadowSync, 1,
  2313.      "(long frameDiffSampleNum, long syncSampleNum) -> None"},
  2314.     {"GetMediaShadowSync", (PyCFunction)MediaObj_GetMediaShadowSync, 1,
  2315.      "(long frameDiffSampleNum) -> (long syncSampleNum)"},
  2316.     {"GetMediaDataSize", (PyCFunction)MediaObj_GetMediaDataSize, 1,
  2317.      "(TimeValue startTime, TimeValue duration) -> (long _rv)"},
  2318.     {"GetMediaNextInterestingTime", (PyCFunction)MediaObj_GetMediaNextInterestingTime, 1,
  2319.      "(short interestingTimeFlags, TimeValue time, Fixed rate) -> (TimeValue interestingTime, TimeValue interestingDuration)"},
  2320.     {"GetMediaDataRef", (PyCFunction)MediaObj_GetMediaDataRef, 1,
  2321.      "(short index) -> (Handle dataRef, OSType dataRefType, long dataRefAttributes)"},
  2322.     {"SetMediaDataRef", (PyCFunction)MediaObj_SetMediaDataRef, 1,
  2323.      "(short index, Handle dataRef, OSType dataRefType) -> None"},
  2324.     {"SetMediaDataRefAttributes", (PyCFunction)MediaObj_SetMediaDataRefAttributes, 1,
  2325.      "(short index, long dataRefAttributes) -> None"},
  2326.     {"AddMediaDataRef", (PyCFunction)MediaObj_AddMediaDataRef, 1,
  2327.      "(Handle dataRef, OSType dataRefType) -> (short index)"},
  2328.     {"GetMediaDataRefCount", (PyCFunction)MediaObj_GetMediaDataRefCount, 1,
  2329.      "() -> (short count)"},
  2330.     {"SetMediaPlayHints", (PyCFunction)MediaObj_SetMediaPlayHints, 1,
  2331.      "(long flags, long flagsMask) -> None"},
  2332.     {NULL, NULL, 0}
  2333. };
  2334.  
  2335. PyMethodChain MediaObj_chain = { MediaObj_methods, NULL };
  2336.  
  2337. static PyObject *MediaObj_getattr(self, name)
  2338.     MediaObject *self;
  2339.     char *name;
  2340. {
  2341.     return Py_FindMethodInChain(&MediaObj_chain, (PyObject *)self, name);
  2342. }
  2343.  
  2344. #define MediaObj_setattr NULL
  2345.  
  2346. PyTypeObject Media_Type = {
  2347.     PyObject_HEAD_INIT(&PyType_Type)
  2348.     0, /*ob_size*/
  2349.     "Media", /*tp_name*/
  2350.     sizeof(MediaObject), /*tp_basicsize*/
  2351.     0, /*tp_itemsize*/
  2352.     /* methods */
  2353.     (destructor) MediaObj_dealloc, /*tp_dealloc*/
  2354.     0, /*tp_print*/
  2355.     (getattrfunc) MediaObj_getattr, /*tp_getattr*/
  2356.     (setattrfunc) MediaObj_setattr, /*tp_setattr*/
  2357. };
  2358.  
  2359. /* --------------------- End object type Media ---------------------- */
  2360.  
  2361.  
  2362. /* ----------------------- Object type Track ------------------------ */
  2363.  
  2364. PyTypeObject Track_Type;
  2365.  
  2366. #define TrackObj_Check(x) ((x)->ob_type == &Track_Type)
  2367.  
  2368. typedef struct TrackObject {
  2369.     PyObject_HEAD
  2370.     Track ob_itself;
  2371. } TrackObject;
  2372.  
  2373. PyObject *TrackObj_New(itself)
  2374.     Track itself;
  2375. {
  2376.     TrackObject *it;
  2377.     if (itself == NULL) {
  2378.                         PyErr_SetString(Qt_Error,"Cannot create null Track");
  2379.                         return NULL;
  2380.                     }
  2381.     it = PyObject_NEW(TrackObject, &Track_Type);
  2382.     if (it == NULL) return NULL;
  2383.     it->ob_itself = itself;
  2384.     return (PyObject *)it;
  2385. }
  2386. TrackObj_Convert(v, p_itself)
  2387.     PyObject *v;
  2388.     Track *p_itself;
  2389. {
  2390.     if (!TrackObj_Check(v))
  2391.     {
  2392.         PyErr_SetString(PyExc_TypeError, "Track required");
  2393.         return 0;
  2394.     }
  2395.     *p_itself = ((TrackObject *)v)->ob_itself;
  2396.     return 1;
  2397. }
  2398.  
  2399. static void TrackObj_dealloc(self)
  2400.     TrackObject *self;
  2401. {
  2402.     DisposeMovieTrack(self->ob_itself);
  2403.     PyMem_DEL(self);
  2404. }
  2405.  
  2406. static PyObject *TrackObj_LoadTrackIntoRam(_self, _args)
  2407.     TrackObject *_self;
  2408.     PyObject *_args;
  2409. {
  2410.     PyObject *_res = NULL;
  2411.     OSErr _err;
  2412.     TimeValue time;
  2413.     TimeValue duration;
  2414.     long flags;
  2415.     if (!PyArg_ParseTuple(_args, "lll",
  2416.                           &time,
  2417.                           &duration,
  2418.                           &flags))
  2419.         return NULL;
  2420.     _err = LoadTrackIntoRam(_self->ob_itself,
  2421.                             time,
  2422.                             duration,
  2423.                             flags);
  2424.     if (_err != noErr) return PyMac_Error(_err);
  2425.     Py_INCREF(Py_None);
  2426.     _res = Py_None;
  2427.     return _res;
  2428. }
  2429.  
  2430. static PyObject *TrackObj_GetTrackPict(_self, _args)
  2431.     TrackObject *_self;
  2432.     PyObject *_args;
  2433. {
  2434.     PyObject *_res = NULL;
  2435.     PicHandle _rv;
  2436.     TimeValue time;
  2437.     if (!PyArg_ParseTuple(_args, "l",
  2438.                           &time))
  2439.         return NULL;
  2440.     _rv = GetTrackPict(_self->ob_itself,
  2441.                        time);
  2442.     _res = Py_BuildValue("O&",
  2443.                          ResObj_New, _rv);
  2444.     return _res;
  2445. }
  2446.  
  2447. static PyObject *TrackObj_GetTrackClipRgn(_self, _args)
  2448.     TrackObject *_self;
  2449.     PyObject *_args;
  2450. {
  2451.     PyObject *_res = NULL;
  2452.     RgnHandle _rv;
  2453.     if (!PyArg_ParseTuple(_args, ""))
  2454.         return NULL;
  2455.     _rv = GetTrackClipRgn(_self->ob_itself);
  2456.     _res = Py_BuildValue("O&",
  2457.                          ResObj_New, _rv);
  2458.     return _res;
  2459. }
  2460.  
  2461. static PyObject *TrackObj_SetTrackClipRgn(_self, _args)
  2462.     TrackObject *_self;
  2463.     PyObject *_args;
  2464. {
  2465.     PyObject *_res = NULL;
  2466.     RgnHandle theClip;
  2467.     if (!PyArg_ParseTuple(_args, "O&",
  2468.                           ResObj_Convert, &theClip))
  2469.         return NULL;
  2470.     SetTrackClipRgn(_self->ob_itself,
  2471.                     theClip);
  2472.     Py_INCREF(Py_None);
  2473.     _res = Py_None;
  2474.     return _res;
  2475. }
  2476.  
  2477. static PyObject *TrackObj_GetTrackDisplayBoundsRgn(_self, _args)
  2478.     TrackObject *_self;
  2479.     PyObject *_args;
  2480. {
  2481.     PyObject *_res = NULL;
  2482.     RgnHandle _rv;
  2483.     if (!PyArg_ParseTuple(_args, ""))
  2484.         return NULL;
  2485.     _rv = GetTrackDisplayBoundsRgn(_self->ob_itself);
  2486.     _res = Py_BuildValue("O&",
  2487.                          ResObj_New, _rv);
  2488.     return _res;
  2489. }
  2490.  
  2491. static PyObject *TrackObj_GetTrackMovieBoundsRgn(_self, _args)
  2492.     TrackObject *_self;
  2493.     PyObject *_args;
  2494. {
  2495.     PyObject *_res = NULL;
  2496.     RgnHandle _rv;
  2497.     if (!PyArg_ParseTuple(_args, ""))
  2498.         return NULL;
  2499.     _rv = GetTrackMovieBoundsRgn(_self->ob_itself);
  2500.     _res = Py_BuildValue("O&",
  2501.                          ResObj_New, _rv);
  2502.     return _res;
  2503. }
  2504.  
  2505. static PyObject *TrackObj_GetTrackBoundsRgn(_self, _args)
  2506.     TrackObject *_self;
  2507.     PyObject *_args;
  2508. {
  2509.     PyObject *_res = NULL;
  2510.     RgnHandle _rv;
  2511.     if (!PyArg_ParseTuple(_args, ""))
  2512.         return NULL;
  2513.     _rv = GetTrackBoundsRgn(_self->ob_itself);
  2514.     _res = Py_BuildValue("O&",
  2515.                          ResObj_New, _rv);
  2516.     return _res;
  2517. }
  2518.  
  2519. static PyObject *TrackObj_GetTrackMatte(_self, _args)
  2520.     TrackObject *_self;
  2521.     PyObject *_args;
  2522. {
  2523.     PyObject *_res = NULL;
  2524.     PixMapHandle _rv;
  2525.     if (!PyArg_ParseTuple(_args, ""))
  2526.         return NULL;
  2527.     _rv = GetTrackMatte(_self->ob_itself);
  2528.     _res = Py_BuildValue("O&",
  2529.                          ResObj_New, _rv);
  2530.     return _res;
  2531. }
  2532.  
  2533. static PyObject *TrackObj_SetTrackMatte(_self, _args)
  2534.     TrackObject *_self;
  2535.     PyObject *_args;
  2536. {
  2537.     PyObject *_res = NULL;
  2538.     PixMapHandle theMatte;
  2539.     if (!PyArg_ParseTuple(_args, "O&",
  2540.                           ResObj_Convert, &theMatte))
  2541.         return NULL;
  2542.     SetTrackMatte(_self->ob_itself,
  2543.                   theMatte);
  2544.     Py_INCREF(Py_None);
  2545.     _res = Py_None;
  2546.     return _res;
  2547. }
  2548.  
  2549. static PyObject *TrackObj_GetTrackID(_self, _args)
  2550.     TrackObject *_self;
  2551.     PyObject *_args;
  2552. {
  2553.     PyObject *_res = NULL;
  2554.     long _rv;
  2555.     if (!PyArg_ParseTuple(_args, ""))
  2556.         return NULL;
  2557.     _rv = GetTrackID(_self->ob_itself);
  2558.     _res = Py_BuildValue("l",
  2559.                          _rv);
  2560.     return _res;
  2561. }
  2562.  
  2563. static PyObject *TrackObj_GetTrackMovie(_self, _args)
  2564.     TrackObject *_self;
  2565.     PyObject *_args;
  2566. {
  2567.     PyObject *_res = NULL;
  2568.     Movie _rv;
  2569.     if (!PyArg_ParseTuple(_args, ""))
  2570.         return NULL;
  2571.     _rv = GetTrackMovie(_self->ob_itself);
  2572.     _res = Py_BuildValue("O&",
  2573.                          MovieObj_New, _rv);
  2574.     return _res;
  2575. }
  2576.  
  2577. static PyObject *TrackObj_GetTrackEnabled(_self, _args)
  2578.     TrackObject *_self;
  2579.     PyObject *_args;
  2580. {
  2581.     PyObject *_res = NULL;
  2582.     Boolean _rv;
  2583.     if (!PyArg_ParseTuple(_args, ""))
  2584.         return NULL;
  2585.     _rv = GetTrackEnabled(_self->ob_itself);
  2586.     _res = Py_BuildValue("b",
  2587.                          _rv);
  2588.     return _res;
  2589. }
  2590.  
  2591. static PyObject *TrackObj_SetTrackEnabled(_self, _args)
  2592.     TrackObject *_self;
  2593.     PyObject *_args;
  2594. {
  2595.     PyObject *_res = NULL;
  2596.     Boolean isEnabled;
  2597.     if (!PyArg_ParseTuple(_args, "b",
  2598.                           &isEnabled))
  2599.         return NULL;
  2600.     SetTrackEnabled(_self->ob_itself,
  2601.                     isEnabled);
  2602.     Py_INCREF(Py_None);
  2603.     _res = Py_None;
  2604.     return _res;
  2605. }
  2606.  
  2607. static PyObject *TrackObj_GetTrackUsage(_self, _args)
  2608.     TrackObject *_self;
  2609.     PyObject *_args;
  2610. {
  2611.     PyObject *_res = NULL;
  2612.     long _rv;
  2613.     if (!PyArg_ParseTuple(_args, ""))
  2614.         return NULL;
  2615.     _rv = GetTrackUsage(_self->ob_itself);
  2616.     _res = Py_BuildValue("l",
  2617.                          _rv);
  2618.     return _res;
  2619. }
  2620.  
  2621. static PyObject *TrackObj_SetTrackUsage(_self, _args)
  2622.     TrackObject *_self;
  2623.     PyObject *_args;
  2624. {
  2625.     PyObject *_res = NULL;
  2626.     long usage;
  2627.     if (!PyArg_ParseTuple(_args, "l",
  2628.                           &usage))
  2629.         return NULL;
  2630.     SetTrackUsage(_self->ob_itself,
  2631.                   usage);
  2632.     Py_INCREF(Py_None);
  2633.     _res = Py_None;
  2634.     return _res;
  2635. }
  2636.  
  2637. static PyObject *TrackObj_GetTrackDuration(_self, _args)
  2638.     TrackObject *_self;
  2639.     PyObject *_args;
  2640. {
  2641.     PyObject *_res = NULL;
  2642.     TimeValue _rv;
  2643.     if (!PyArg_ParseTuple(_args, ""))
  2644.         return NULL;
  2645.     _rv = GetTrackDuration(_self->ob_itself);
  2646.     _res = Py_BuildValue("l",
  2647.                          _rv);
  2648.     return _res;
  2649. }
  2650.  
  2651. static PyObject *TrackObj_GetTrackOffset(_self, _args)
  2652.     TrackObject *_self;
  2653.     PyObject *_args;
  2654. {
  2655.     PyObject *_res = NULL;
  2656.     TimeValue _rv;
  2657.     if (!PyArg_ParseTuple(_args, ""))
  2658.         return NULL;
  2659.     _rv = GetTrackOffset(_self->ob_itself);
  2660.     _res = Py_BuildValue("l",
  2661.                          _rv);
  2662.     return _res;
  2663. }
  2664.  
  2665. static PyObject *TrackObj_SetTrackOffset(_self, _args)
  2666.     TrackObject *_self;
  2667.     PyObject *_args;
  2668. {
  2669.     PyObject *_res = NULL;
  2670.     TimeValue movieOffsetTime;
  2671.     if (!PyArg_ParseTuple(_args, "l",
  2672.                           &movieOffsetTime))
  2673.         return NULL;
  2674.     SetTrackOffset(_self->ob_itself,
  2675.                    movieOffsetTime);
  2676.     Py_INCREF(Py_None);
  2677.     _res = Py_None;
  2678.     return _res;
  2679. }
  2680.  
  2681. static PyObject *TrackObj_GetTrackLayer(_self, _args)
  2682.     TrackObject *_self;
  2683.     PyObject *_args;
  2684. {
  2685.     PyObject *_res = NULL;
  2686.     short _rv;
  2687.     if (!PyArg_ParseTuple(_args, ""))
  2688.         return NULL;
  2689.     _rv = GetTrackLayer(_self->ob_itself);
  2690.     _res = Py_BuildValue("h",
  2691.                          _rv);
  2692.     return _res;
  2693. }
  2694.  
  2695. static PyObject *TrackObj_SetTrackLayer(_self, _args)
  2696.     TrackObject *_self;
  2697.     PyObject *_args;
  2698. {
  2699.     PyObject *_res = NULL;
  2700.     short layer;
  2701.     if (!PyArg_ParseTuple(_args, "h",
  2702.                           &layer))
  2703.         return NULL;
  2704.     SetTrackLayer(_self->ob_itself,
  2705.                   layer);
  2706.     Py_INCREF(Py_None);
  2707.     _res = Py_None;
  2708.     return _res;
  2709. }
  2710.  
  2711. static PyObject *TrackObj_GetTrackAlternate(_self, _args)
  2712.     TrackObject *_self;
  2713.     PyObject *_args;
  2714. {
  2715.     PyObject *_res = NULL;
  2716.     Track _rv;
  2717.     if (!PyArg_ParseTuple(_args, ""))
  2718.         return NULL;
  2719.     _rv = GetTrackAlternate(_self->ob_itself);
  2720.     _res = Py_BuildValue("O&",
  2721.                          TrackObj_New, _rv);
  2722.     return _res;
  2723. }
  2724.  
  2725. static PyObject *TrackObj_SetTrackAlternate(_self, _args)
  2726.     TrackObject *_self;
  2727.     PyObject *_args;
  2728. {
  2729.     PyObject *_res = NULL;
  2730.     Track alternateT;
  2731.     if (!PyArg_ParseTuple(_args, "O&",
  2732.                           TrackObj_Convert, &alternateT))
  2733.         return NULL;
  2734.     SetTrackAlternate(_self->ob_itself,
  2735.                       alternateT);
  2736.     Py_INCREF(Py_None);
  2737.     _res = Py_None;
  2738.     return _res;
  2739. }
  2740.  
  2741. static PyObject *TrackObj_GetTrackVolume(_self, _args)
  2742.     TrackObject *_self;
  2743.     PyObject *_args;
  2744. {
  2745.     PyObject *_res = NULL;
  2746.     short _rv;
  2747.     if (!PyArg_ParseTuple(_args, ""))
  2748.         return NULL;
  2749.     _rv = GetTrackVolume(_self->ob_itself);
  2750.     _res = Py_BuildValue("h",
  2751.                          _rv);
  2752.     return _res;
  2753. }
  2754.  
  2755. static PyObject *TrackObj_SetTrackVolume(_self, _args)
  2756.     TrackObject *_self;
  2757.     PyObject *_args;
  2758. {
  2759.     PyObject *_res = NULL;
  2760.     short volume;
  2761.     if (!PyArg_ParseTuple(_args, "h",
  2762.                           &volume))
  2763.         return NULL;
  2764.     SetTrackVolume(_self->ob_itself,
  2765.                    volume);
  2766.     Py_INCREF(Py_None);
  2767.     _res = Py_None;
  2768.     return _res;
  2769. }
  2770.  
  2771. static PyObject *TrackObj_GetTrackDimensions(_self, _args)
  2772.     TrackObject *_self;
  2773.     PyObject *_args;
  2774. {
  2775.     PyObject *_res = NULL;
  2776.     Fixed width;
  2777.     Fixed height;
  2778.     if (!PyArg_ParseTuple(_args, ""))
  2779.         return NULL;
  2780.     GetTrackDimensions(_self->ob_itself,
  2781.                        &width,
  2782.                        &height);
  2783.     _res = Py_BuildValue("O&O&",
  2784.                          PyMac_BuildFixed, width,
  2785.                          PyMac_BuildFixed, height);
  2786.     return _res;
  2787. }
  2788.  
  2789. static PyObject *TrackObj_SetTrackDimensions(_self, _args)
  2790.     TrackObject *_self;
  2791.     PyObject *_args;
  2792. {
  2793.     PyObject *_res = NULL;
  2794.     Fixed width;
  2795.     Fixed height;
  2796.     if (!PyArg_ParseTuple(_args, "O&O&",
  2797.                           PyMac_GetFixed, &width,
  2798.                           PyMac_GetFixed, &height))
  2799.         return NULL;
  2800.     SetTrackDimensions(_self->ob_itself,
  2801.                        width,
  2802.                        height);
  2803.     Py_INCREF(Py_None);
  2804.     _res = Py_None;
  2805.     return _res;
  2806. }
  2807.  
  2808. static PyObject *TrackObj_GetTrackUserData(_self, _args)
  2809.     TrackObject *_self;
  2810.     PyObject *_args;
  2811. {
  2812.     PyObject *_res = NULL;
  2813.     UserData _rv;
  2814.     if (!PyArg_ParseTuple(_args, ""))
  2815.         return NULL;
  2816.     _rv = GetTrackUserData(_self->ob_itself);
  2817.     _res = Py_BuildValue("O&",
  2818.                          UserDataObj_New, _rv);
  2819.     return _res;
  2820. }
  2821.  
  2822. static PyObject *TrackObj_NewTrackMedia(_self, _args)
  2823.     TrackObject *_self;
  2824.     PyObject *_args;
  2825. {
  2826.     PyObject *_res = NULL;
  2827.     Media _rv;
  2828.     OSType mediaType;
  2829.     TimeScale timeScale;
  2830.     Handle dataRef;
  2831.     OSType dataRefType;
  2832.     if (!PyArg_ParseTuple(_args, "O&lO&O&",
  2833.                           PyMac_GetOSType, &mediaType,
  2834.                           &timeScale,
  2835.                           ResObj_Convert, &dataRef,
  2836.                           PyMac_GetOSType, &dataRefType))
  2837.         return NULL;
  2838.     _rv = NewTrackMedia(_self->ob_itself,
  2839.                         mediaType,
  2840.                         timeScale,
  2841.                         dataRef,
  2842.                         dataRefType);
  2843.     _res = Py_BuildValue("O&",
  2844.                          MediaObj_New, _rv);
  2845.     return _res;
  2846. }
  2847.  
  2848. static PyObject *TrackObj_GetTrackMedia(_self, _args)
  2849.     TrackObject *_self;
  2850.     PyObject *_args;
  2851. {
  2852.     PyObject *_res = NULL;
  2853.     Media _rv;
  2854.     if (!PyArg_ParseTuple(_args, ""))
  2855.         return NULL;
  2856.     _rv = GetTrackMedia(_self->ob_itself);
  2857.     _res = Py_BuildValue("O&",
  2858.                          MediaObj_New, _rv);
  2859.     return _res;
  2860. }
  2861.  
  2862. static PyObject *TrackObj_InsertMediaIntoTrack(_self, _args)
  2863.     TrackObject *_self;
  2864.     PyObject *_args;
  2865. {
  2866.     PyObject *_res = NULL;
  2867.     OSErr _err;
  2868.     TimeValue trackStart;
  2869.     TimeValue mediaTime;
  2870.     TimeValue mediaDuration;
  2871.     Fixed mediaRate;
  2872.     if (!PyArg_ParseTuple(_args, "lllO&",
  2873.                           &trackStart,
  2874.                           &mediaTime,
  2875.                           &mediaDuration,
  2876.                           PyMac_GetFixed, &mediaRate))
  2877.         return NULL;
  2878.     _err = InsertMediaIntoTrack(_self->ob_itself,
  2879.                                 trackStart,
  2880.                                 mediaTime,
  2881.                                 mediaDuration,
  2882.                                 mediaRate);
  2883.     if (_err != noErr) return PyMac_Error(_err);
  2884.     Py_INCREF(Py_None);
  2885.     _res = Py_None;
  2886.     return _res;
  2887. }
  2888.  
  2889. static PyObject *TrackObj_InsertTrackSegment(_self, _args)
  2890.     TrackObject *_self;
  2891.     PyObject *_args;
  2892. {
  2893.     PyObject *_res = NULL;
  2894.     OSErr _err;
  2895.     Track dstTrack;
  2896.     TimeValue srcIn;
  2897.     TimeValue srcDuration;
  2898.     TimeValue dstIn;
  2899.     if (!PyArg_ParseTuple(_args, "O&lll",
  2900.                           TrackObj_Convert, &dstTrack,
  2901.                           &srcIn,
  2902.                           &srcDuration,
  2903.                           &dstIn))
  2904.         return NULL;
  2905.     _err = InsertTrackSegment(_self->ob_itself,
  2906.                               dstTrack,
  2907.                               srcIn,
  2908.                               srcDuration,
  2909.                               dstIn);
  2910.     if (_err != noErr) return PyMac_Error(_err);
  2911.     Py_INCREF(Py_None);
  2912.     _res = Py_None;
  2913.     return _res;
  2914. }
  2915.  
  2916. static PyObject *TrackObj_InsertEmptyTrackSegment(_self, _args)
  2917.     TrackObject *_self;
  2918.     PyObject *_args;
  2919. {
  2920.     PyObject *_res = NULL;
  2921.     OSErr _err;
  2922.     TimeValue dstIn;
  2923.     TimeValue dstDuration;
  2924.     if (!PyArg_ParseTuple(_args, "ll",
  2925.                           &dstIn,
  2926.                           &dstDuration))
  2927.         return NULL;
  2928.     _err = InsertEmptyTrackSegment(_self->ob_itself,
  2929.                                    dstIn,
  2930.                                    dstDuration);
  2931.     if (_err != noErr) return PyMac_Error(_err);
  2932.     Py_INCREF(Py_None);
  2933.     _res = Py_None;
  2934.     return _res;
  2935. }
  2936.  
  2937. static PyObject *TrackObj_DeleteTrackSegment(_self, _args)
  2938.     TrackObject *_self;
  2939.     PyObject *_args;
  2940. {
  2941.     PyObject *_res = NULL;
  2942.     OSErr _err;
  2943.     TimeValue startTime;
  2944.     TimeValue duration;
  2945.     if (!PyArg_ParseTuple(_args, "ll",
  2946.                           &startTime,
  2947.                           &duration))
  2948.         return NULL;
  2949.     _err = DeleteTrackSegment(_self->ob_itself,
  2950.                               startTime,
  2951.                               duration);
  2952.     if (_err != noErr) return PyMac_Error(_err);
  2953.     Py_INCREF(Py_None);
  2954.     _res = Py_None;
  2955.     return _res;
  2956. }
  2957.  
  2958. static PyObject *TrackObj_ScaleTrackSegment(_self, _args)
  2959.     TrackObject *_self;
  2960.     PyObject *_args;
  2961. {
  2962.     PyObject *_res = NULL;
  2963.     OSErr _err;
  2964.     TimeValue startTime;
  2965.     TimeValue oldDuration;
  2966.     TimeValue newDuration;
  2967.     if (!PyArg_ParseTuple(_args, "lll",
  2968.                           &startTime,
  2969.                           &oldDuration,
  2970.                           &newDuration))
  2971.         return NULL;
  2972.     _err = ScaleTrackSegment(_self->ob_itself,
  2973.                              startTime,
  2974.                              oldDuration,
  2975.                              newDuration);
  2976.     if (_err != noErr) return PyMac_Error(_err);
  2977.     Py_INCREF(Py_None);
  2978.     _res = Py_None;
  2979.     return _res;
  2980. }
  2981.  
  2982. static PyObject *TrackObj_IsScrapMovie(_self, _args)
  2983.     TrackObject *_self;
  2984.     PyObject *_args;
  2985. {
  2986.     PyObject *_res = NULL;
  2987.     Component _rv;
  2988.     if (!PyArg_ParseTuple(_args, ""))
  2989.         return NULL;
  2990.     _rv = IsScrapMovie(_self->ob_itself);
  2991.     _res = Py_BuildValue("O&",
  2992.                          CmpObj_New, _rv);
  2993.     return _res;
  2994. }
  2995.  
  2996. static PyObject *TrackObj_CopyTrackSettings(_self, _args)
  2997.     TrackObject *_self;
  2998.     PyObject *_args;
  2999. {
  3000.     PyObject *_res = NULL;
  3001.     OSErr _err;
  3002.     Track dstTrack;
  3003.     if (!PyArg_ParseTuple(_args, "O&",
  3004.                           TrackObj_Convert, &dstTrack))
  3005.         return NULL;
  3006.     _err = CopyTrackSettings(_self->ob_itself,
  3007.                              dstTrack);
  3008.     if (_err != noErr) return PyMac_Error(_err);
  3009.     Py_INCREF(Py_None);
  3010.     _res = Py_None;
  3011.     return _res;
  3012. }
  3013.  
  3014. static PyObject *TrackObj_AddEmptyTrackToMovie(_self, _args)
  3015.     TrackObject *_self;
  3016.     PyObject *_args;
  3017. {
  3018.     PyObject *_res = NULL;
  3019.     OSErr _err;
  3020.     Movie dstMovie;
  3021.     Handle dataRef;
  3022.     OSType dataRefType;
  3023.     Track dstTrack;
  3024.     if (!PyArg_ParseTuple(_args, "O&O&O&",
  3025.                           MovieObj_Convert, &dstMovie,
  3026.                           ResObj_Convert, &dataRef,
  3027.                           PyMac_GetOSType, &dataRefType))
  3028.         return NULL;
  3029.     _err = AddEmptyTrackToMovie(_self->ob_itself,
  3030.                                 dstMovie,
  3031.                                 dataRef,
  3032.                                 dataRefType,
  3033.                                 &dstTrack);
  3034.     if (_err != noErr) return PyMac_Error(_err);
  3035.     _res = Py_BuildValue("O&",
  3036.                          TrackObj_New, dstTrack);
  3037.     return _res;
  3038. }
  3039.  
  3040. static PyObject *TrackObj_AddTrackReference(_self, _args)
  3041.     TrackObject *_self;
  3042.     PyObject *_args;
  3043. {
  3044.     PyObject *_res = NULL;
  3045.     OSErr _err;
  3046.     Track refTrack;
  3047.     OSType refType;
  3048.     long addedIndex;
  3049.     if (!PyArg_ParseTuple(_args, "O&O&",
  3050.                           TrackObj_Convert, &refTrack,
  3051.                           PyMac_GetOSType, &refType))
  3052.         return NULL;
  3053.     _err = AddTrackReference(_self->ob_itself,
  3054.                              refTrack,
  3055.                              refType,
  3056.                              &addedIndex);
  3057.     if (_err != noErr) return PyMac_Error(_err);
  3058.     _res = Py_BuildValue("l",
  3059.                          addedIndex);
  3060.     return _res;
  3061. }
  3062.  
  3063. static PyObject *TrackObj_DeleteTrackReference(_self, _args)
  3064.     TrackObject *_self;
  3065.     PyObject *_args;
  3066. {
  3067.     PyObject *_res = NULL;
  3068.     OSErr _err;
  3069.     OSType refType;
  3070.     long index;
  3071.     if (!PyArg_ParseTuple(_args, "O&l",
  3072.                           PyMac_GetOSType, &refType,
  3073.                           &index))
  3074.         return NULL;
  3075.     _err = DeleteTrackReference(_self->ob_itself,
  3076.                                 refType,
  3077.                                 index);
  3078.     if (_err != noErr) return PyMac_Error(_err);
  3079.     Py_INCREF(Py_None);
  3080.     _res = Py_None;
  3081.     return _res;
  3082. }
  3083.  
  3084. static PyObject *TrackObj_SetTrackReference(_self, _args)
  3085.     TrackObject *_self;
  3086.     PyObject *_args;
  3087. {
  3088.     PyObject *_res = NULL;
  3089.     OSErr _err;
  3090.     Track refTrack;
  3091.     OSType refType;
  3092.     long index;
  3093.     if (!PyArg_ParseTuple(_args, "O&O&l",
  3094.                           TrackObj_Convert, &refTrack,
  3095.                           PyMac_GetOSType, &refType,
  3096.                           &index))
  3097.         return NULL;
  3098.     _err = SetTrackReference(_self->ob_itself,
  3099.                              refTrack,
  3100.                              refType,
  3101.                              index);
  3102.     if (_err != noErr) return PyMac_Error(_err);
  3103.     Py_INCREF(Py_None);
  3104.     _res = Py_None;
  3105.     return _res;
  3106. }
  3107.  
  3108. static PyObject *TrackObj_GetTrackReference(_self, _args)
  3109.     TrackObject *_self;
  3110.     PyObject *_args;
  3111. {
  3112.     PyObject *_res = NULL;
  3113.     Track _rv;
  3114.     OSType refType;
  3115.     long index;
  3116.     if (!PyArg_ParseTuple(_args, "O&l",
  3117.                           PyMac_GetOSType, &refType,
  3118.                           &index))
  3119.         return NULL;
  3120.     _rv = GetTrackReference(_self->ob_itself,
  3121.                             refType,
  3122.                             index);
  3123.     _res = Py_BuildValue("O&",
  3124.                          TrackObj_New, _rv);
  3125.     return _res;
  3126. }
  3127.  
  3128. static PyObject *TrackObj_GetNextTrackReferenceType(_self, _args)
  3129.     TrackObject *_self;
  3130.     PyObject *_args;
  3131. {
  3132.     PyObject *_res = NULL;
  3133.     OSType _rv;
  3134.     OSType refType;
  3135.     if (!PyArg_ParseTuple(_args, "O&",
  3136.                           PyMac_GetOSType, &refType))
  3137.         return NULL;
  3138.     _rv = GetNextTrackReferenceType(_self->ob_itself,
  3139.                                     refType);
  3140.     _res = Py_BuildValue("O&",
  3141.                          PyMac_BuildOSType, _rv);
  3142.     return _res;
  3143. }
  3144.  
  3145. static PyObject *TrackObj_GetTrackReferenceCount(_self, _args)
  3146.     TrackObject *_self;
  3147.     PyObject *_args;
  3148. {
  3149.     PyObject *_res = NULL;
  3150.     long _rv;
  3151.     OSType refType;
  3152.     if (!PyArg_ParseTuple(_args, "O&",
  3153.                           PyMac_GetOSType, &refType))
  3154.         return NULL;
  3155.     _rv = GetTrackReferenceCount(_self->ob_itself,
  3156.                                  refType);
  3157.     _res = Py_BuildValue("l",
  3158.                          _rv);
  3159.     return _res;
  3160. }
  3161.  
  3162. static PyObject *TrackObj_GetTrackEditRate(_self, _args)
  3163.     TrackObject *_self;
  3164.     PyObject *_args;
  3165. {
  3166.     PyObject *_res = NULL;
  3167.     Fixed _rv;
  3168.     TimeValue atTime;
  3169.     if (!PyArg_ParseTuple(_args, "l",
  3170.                           &atTime))
  3171.         return NULL;
  3172.     _rv = GetTrackEditRate(_self->ob_itself,
  3173.                            atTime);
  3174.     _res = Py_BuildValue("O&",
  3175.                          PyMac_BuildFixed, _rv);
  3176.     return _res;
  3177. }
  3178.  
  3179. static PyObject *TrackObj_GetTrackDataSize(_self, _args)
  3180.     TrackObject *_self;
  3181.     PyObject *_args;
  3182. {
  3183.     PyObject *_res = NULL;
  3184.     long _rv;
  3185.     TimeValue startTime;
  3186.     TimeValue duration;
  3187.     if (!PyArg_ParseTuple(_args, "ll",
  3188.                           &startTime,
  3189.                           &duration))
  3190.         return NULL;
  3191.     _rv = GetTrackDataSize(_self->ob_itself,
  3192.                            startTime,
  3193.                            duration);
  3194.     _res = Py_BuildValue("l",
  3195.                          _rv);
  3196.     return _res;
  3197. }
  3198.  
  3199. static PyObject *TrackObj_PtInTrack(_self, _args)
  3200.     TrackObject *_self;
  3201.     PyObject *_args;
  3202. {
  3203.     PyObject *_res = NULL;
  3204.     Boolean _rv;
  3205.     Point pt;
  3206.     if (!PyArg_ParseTuple(_args, "O&",
  3207.                           PyMac_GetPoint, &pt))
  3208.         return NULL;
  3209.     _rv = PtInTrack(_self->ob_itself,
  3210.                     pt);
  3211.     _res = Py_BuildValue("b",
  3212.                          _rv);
  3213.     return _res;
  3214. }
  3215.  
  3216. static PyObject *TrackObj_GetTrackNextInterestingTime(_self, _args)
  3217.     TrackObject *_self;
  3218.     PyObject *_args;
  3219. {
  3220.     PyObject *_res = NULL;
  3221.     short interestingTimeFlags;
  3222.     TimeValue time;
  3223.     Fixed rate;
  3224.     TimeValue interestingTime;
  3225.     TimeValue interestingDuration;
  3226.     if (!PyArg_ParseTuple(_args, "hlO&",
  3227.                           &interestingTimeFlags,
  3228.                           &time,
  3229.                           PyMac_GetFixed, &rate))
  3230.         return NULL;
  3231.     GetTrackNextInterestingTime(_self->ob_itself,
  3232.                                 interestingTimeFlags,
  3233.                                 time,
  3234.                                 rate,
  3235.                                 &interestingTime,
  3236.                                 &interestingDuration);
  3237.     _res = Py_BuildValue("ll",
  3238.                          interestingTime,
  3239.                          interestingDuration);
  3240.     return _res;
  3241. }
  3242.  
  3243. static PyObject *TrackObj_GetTrackSegmentDisplayBoundsRgn(_self, _args)
  3244.     TrackObject *_self;
  3245.     PyObject *_args;
  3246. {
  3247.     PyObject *_res = NULL;
  3248.     RgnHandle _rv;
  3249.     TimeValue time;
  3250.     TimeValue duration;
  3251.     if (!PyArg_ParseTuple(_args, "ll",
  3252.                           &time,
  3253.                           &duration))
  3254.         return NULL;
  3255.     _rv = GetTrackSegmentDisplayBoundsRgn(_self->ob_itself,
  3256.                                           time,
  3257.                                           duration);
  3258.     _res = Py_BuildValue("O&",
  3259.                          ResObj_New, _rv);
  3260.     return _res;
  3261. }
  3262.  
  3263. static PyObject *TrackObj_GetTrackStatus(_self, _args)
  3264.     TrackObject *_self;
  3265.     PyObject *_args;
  3266. {
  3267.     PyObject *_res = NULL;
  3268.     ComponentResult _rv;
  3269.     if (!PyArg_ParseTuple(_args, ""))
  3270.         return NULL;
  3271.     _rv = GetTrackStatus(_self->ob_itself);
  3272.     _res = Py_BuildValue("l",
  3273.                          _rv);
  3274.     return _res;
  3275. }
  3276.  
  3277. static PyObject *TrackObj_SetTrackLoadSettings(_self, _args)
  3278.     TrackObject *_self;
  3279.     PyObject *_args;
  3280. {
  3281.     PyObject *_res = NULL;
  3282.     TimeValue preloadTime;
  3283.     TimeValue preloadDuration;
  3284.     long preloadFlags;
  3285.     long defaultHints;
  3286.     if (!PyArg_ParseTuple(_args, "llll",
  3287.                           &preloadTime,
  3288.                           &preloadDuration,
  3289.                           &preloadFlags,
  3290.                           &defaultHints))
  3291.         return NULL;
  3292.     SetTrackLoadSettings(_self->ob_itself,
  3293.                          preloadTime,
  3294.                          preloadDuration,
  3295.                          preloadFlags,
  3296.                          defaultHints);
  3297.     Py_INCREF(Py_None);
  3298.     _res = Py_None;
  3299.     return _res;
  3300. }
  3301.  
  3302. static PyObject *TrackObj_GetTrackLoadSettings(_self, _args)
  3303.     TrackObject *_self;
  3304.     PyObject *_args;
  3305. {
  3306.     PyObject *_res = NULL;
  3307.     TimeValue preloadTime;
  3308.     TimeValue preloadDuration;
  3309.     long preloadFlags;
  3310.     long defaultHints;
  3311.     if (!PyArg_ParseTuple(_args, ""))
  3312.         return NULL;
  3313.     GetTrackLoadSettings(_self->ob_itself,
  3314.                          &preloadTime,
  3315.                          &preloadDuration,
  3316.                          &preloadFlags,
  3317.                          &defaultHints);
  3318.     _res = Py_BuildValue("llll",
  3319.                          preloadTime,
  3320.                          preloadDuration,
  3321.                          preloadFlags,
  3322.                          defaultHints);
  3323.     return _res;
  3324. }
  3325.  
  3326. static PyMethodDef TrackObj_methods[] = {
  3327.     {"LoadTrackIntoRam", (PyCFunction)TrackObj_LoadTrackIntoRam, 1,
  3328.      "(TimeValue time, TimeValue duration, long flags) -> None"},
  3329.     {"GetTrackPict", (PyCFunction)TrackObj_GetTrackPict, 1,
  3330.      "(TimeValue time) -> (PicHandle _rv)"},
  3331.     {"GetTrackClipRgn", (PyCFunction)TrackObj_GetTrackClipRgn, 1,
  3332.      "() -> (RgnHandle _rv)"},
  3333.     {"SetTrackClipRgn", (PyCFunction)TrackObj_SetTrackClipRgn, 1,
  3334.      "(RgnHandle theClip) -> None"},
  3335.     {"GetTrackDisplayBoundsRgn", (PyCFunction)TrackObj_GetTrackDisplayBoundsRgn, 1,
  3336.      "() -> (RgnHandle _rv)"},
  3337.     {"GetTrackMovieBoundsRgn", (PyCFunction)TrackObj_GetTrackMovieBoundsRgn, 1,
  3338.      "() -> (RgnHandle _rv)"},
  3339.     {"GetTrackBoundsRgn", (PyCFunction)TrackObj_GetTrackBoundsRgn, 1,
  3340.      "() -> (RgnHandle _rv)"},
  3341.     {"GetTrackMatte", (PyCFunction)TrackObj_GetTrackMatte, 1,
  3342.      "() -> (PixMapHandle _rv)"},
  3343.     {"SetTrackMatte", (PyCFunction)TrackObj_SetTrackMatte, 1,
  3344.      "(PixMapHandle theMatte) -> None"},
  3345.     {"GetTrackID", (PyCFunction)TrackObj_GetTrackID, 1,
  3346.      "() -> (long _rv)"},
  3347.     {"GetTrackMovie", (PyCFunction)TrackObj_GetTrackMovie, 1,
  3348.      "() -> (Movie _rv)"},
  3349.     {"GetTrackEnabled", (PyCFunction)TrackObj_GetTrackEnabled, 1,
  3350.      "() -> (Boolean _rv)"},
  3351.     {"SetTrackEnabled", (PyCFunction)TrackObj_SetTrackEnabled, 1,
  3352.      "(Boolean isEnabled) -> None"},
  3353.     {"GetTrackUsage", (PyCFunction)TrackObj_GetTrackUsage, 1,
  3354.      "() -> (long _rv)"},
  3355.     {"SetTrackUsage", (PyCFunction)TrackObj_SetTrackUsage, 1,
  3356.      "(long usage) -> None"},
  3357.     {"GetTrackDuration", (PyCFunction)TrackObj_GetTrackDuration, 1,
  3358.      "() -> (TimeValue _rv)"},
  3359.     {"GetTrackOffset", (PyCFunction)TrackObj_GetTrackOffset, 1,
  3360.      "() -> (TimeValue _rv)"},
  3361.     {"SetTrackOffset", (PyCFunction)TrackObj_SetTrackOffset, 1,
  3362.      "(TimeValue movieOffsetTime) -> None"},
  3363.     {"GetTrackLayer", (PyCFunction)TrackObj_GetTrackLayer, 1,
  3364.      "() -> (short _rv)"},
  3365.     {"SetTrackLayer", (PyCFunction)TrackObj_SetTrackLayer, 1,
  3366.      "(short layer) -> None"},
  3367.     {"GetTrackAlternate", (PyCFunction)TrackObj_GetTrackAlternate, 1,
  3368.      "() -> (Track _rv)"},
  3369.     {"SetTrackAlternate", (PyCFunction)TrackObj_SetTrackAlternate, 1,
  3370.      "(Track alternateT) -> None"},
  3371.     {"GetTrackVolume", (PyCFunction)TrackObj_GetTrackVolume, 1,
  3372.      "() -> (short _rv)"},
  3373.     {"SetTrackVolume", (PyCFunction)TrackObj_SetTrackVolume, 1,
  3374.      "(short volume) -> None"},
  3375.     {"GetTrackDimensions", (PyCFunction)TrackObj_GetTrackDimensions, 1,
  3376.      "() -> (Fixed width, Fixed height)"},
  3377.     {"SetTrackDimensions", (PyCFunction)TrackObj_SetTrackDimensions, 1,
  3378.      "(Fixed width, Fixed height) -> None"},
  3379.     {"GetTrackUserData", (PyCFunction)TrackObj_GetTrackUserData, 1,
  3380.      "() -> (UserData _rv)"},
  3381.     {"NewTrackMedia", (PyCFunction)TrackObj_NewTrackMedia, 1,
  3382.      "(OSType mediaType, TimeScale timeScale, Handle dataRef, OSType dataRefType) -> (Media _rv)"},
  3383.     {"GetTrackMedia", (PyCFunction)TrackObj_GetTrackMedia, 1,
  3384.      "() -> (Media _rv)"},
  3385.     {"InsertMediaIntoTrack", (PyCFunction)TrackObj_InsertMediaIntoTrack, 1,
  3386.      "(TimeValue trackStart, TimeValue mediaTime, TimeValue mediaDuration, Fixed mediaRate) -> None"},
  3387.     {"InsertTrackSegment", (PyCFunction)TrackObj_InsertTrackSegment, 1,
  3388.      "(Track dstTrack, TimeValue srcIn, TimeValue srcDuration, TimeValue dstIn) -> None"},
  3389.     {"InsertEmptyTrackSegment", (PyCFunction)TrackObj_InsertEmptyTrackSegment, 1,
  3390.      "(TimeValue dstIn, TimeValue dstDuration) -> None"},
  3391.     {"DeleteTrackSegment", (PyCFunction)TrackObj_DeleteTrackSegment, 1,
  3392.      "(TimeValue startTime, TimeValue duration) -> None"},
  3393.     {"ScaleTrackSegment", (PyCFunction)TrackObj_ScaleTrackSegment, 1,
  3394.      "(TimeValue startTime, TimeValue oldDuration, TimeValue newDuration) -> None"},
  3395.     {"IsScrapMovie", (PyCFunction)TrackObj_IsScrapMovie, 1,
  3396.      "() -> (Component _rv)"},
  3397.     {"CopyTrackSettings", (PyCFunction)TrackObj_CopyTrackSettings, 1,
  3398.      "(Track dstTrack) -> None"},
  3399.     {"AddEmptyTrackToMovie", (PyCFunction)TrackObj_AddEmptyTrackToMovie, 1,
  3400.      "(Movie dstMovie, Handle dataRef, OSType dataRefType) -> (Track dstTrack)"},
  3401.     {"AddTrackReference", (PyCFunction)TrackObj_AddTrackReference, 1,
  3402.      "(Track refTrack, OSType refType) -> (long addedIndex)"},
  3403.     {"DeleteTrackReference", (PyCFunction)TrackObj_DeleteTrackReference, 1,
  3404.      "(OSType refType, long index) -> None"},
  3405.     {"SetTrackReference", (PyCFunction)TrackObj_SetTrackReference, 1,
  3406.      "(Track refTrack, OSType refType, long index) -> None"},
  3407.     {"GetTrackReference", (PyCFunction)TrackObj_GetTrackReference, 1,
  3408.      "(OSType refType, long index) -> (Track _rv)"},
  3409.     {"GetNextTrackReferenceType", (PyCFunction)TrackObj_GetNextTrackReferenceType, 1,
  3410.      "(OSType refType) -> (OSType _rv)"},
  3411.     {"GetTrackReferenceCount", (PyCFunction)TrackObj_GetTrackReferenceCount, 1,
  3412.      "(OSType refType) -> (long _rv)"},
  3413.     {"GetTrackEditRate", (PyCFunction)TrackObj_GetTrackEditRate, 1,
  3414.      "(TimeValue atTime) -> (Fixed _rv)"},
  3415.     {"GetTrackDataSize", (PyCFunction)TrackObj_GetTrackDataSize, 1,
  3416.      "(TimeValue startTime, TimeValue duration) -> (long _rv)"},
  3417.     {"PtInTrack", (PyCFunction)TrackObj_PtInTrack, 1,
  3418.      "(Point pt) -> (Boolean _rv)"},
  3419.     {"GetTrackNextInterestingTime", (PyCFunction)TrackObj_GetTrackNextInterestingTime, 1,
  3420.      "(short interestingTimeFlags, TimeValue time, Fixed rate) -> (TimeValue interestingTime, TimeValue interestingDuration)"},
  3421.     {"GetTrackSegmentDisplayBoundsRgn", (PyCFunction)TrackObj_GetTrackSegmentDisplayBoundsRgn, 1,
  3422.      "(TimeValue time, TimeValue duration) -> (RgnHandle _rv)"},
  3423.     {"GetTrackStatus", (PyCFunction)TrackObj_GetTrackStatus, 1,
  3424.      "() -> (ComponentResult _rv)"},
  3425.     {"SetTrackLoadSettings", (PyCFunction)TrackObj_SetTrackLoadSettings, 1,
  3426.      "(TimeValue preloadTime, TimeValue preloadDuration, long preloadFlags, long defaultHints) -> None"},
  3427.     {"GetTrackLoadSettings", (PyCFunction)TrackObj_GetTrackLoadSettings, 1,
  3428.      "() -> (TimeValue preloadTime, TimeValue preloadDuration, long preloadFlags, long defaultHints)"},
  3429.     {NULL, NULL, 0}
  3430. };
  3431.  
  3432. PyMethodChain TrackObj_chain = { TrackObj_methods, NULL };
  3433.  
  3434. static PyObject *TrackObj_getattr(self, name)
  3435.     TrackObject *self;
  3436.     char *name;
  3437. {
  3438.     return Py_FindMethodInChain(&TrackObj_chain, (PyObject *)self, name);
  3439. }
  3440.  
  3441. #define TrackObj_setattr NULL
  3442.  
  3443. PyTypeObject Track_Type = {
  3444.     PyObject_HEAD_INIT(&PyType_Type)
  3445.     0, /*ob_size*/
  3446.     "Track", /*tp_name*/
  3447.     sizeof(TrackObject), /*tp_basicsize*/
  3448.     0, /*tp_itemsize*/
  3449.     /* methods */
  3450.     (destructor) TrackObj_dealloc, /*tp_dealloc*/
  3451.     0, /*tp_print*/
  3452.     (getattrfunc) TrackObj_getattr, /*tp_getattr*/
  3453.     (setattrfunc) TrackObj_setattr, /*tp_setattr*/
  3454. };
  3455.  
  3456. /* --------------------- End object type Track ---------------------- */
  3457.  
  3458.  
  3459. /* ----------------------- Object type Movie ------------------------ */
  3460.  
  3461. PyTypeObject Movie_Type;
  3462.  
  3463. #define MovieObj_Check(x) ((x)->ob_type == &Movie_Type)
  3464.  
  3465. typedef struct MovieObject {
  3466.     PyObject_HEAD
  3467.     Movie ob_itself;
  3468. } MovieObject;
  3469.  
  3470. PyObject *MovieObj_New(itself)
  3471.     Movie itself;
  3472. {
  3473.     MovieObject *it;
  3474.     if (itself == NULL) {
  3475.                         PyErr_SetString(Qt_Error,"Cannot create null Movie");
  3476.                         return NULL;
  3477.                     }
  3478.     it = PyObject_NEW(MovieObject, &Movie_Type);
  3479.     if (it == NULL) return NULL;
  3480.     it->ob_itself = itself;
  3481.     return (PyObject *)it;
  3482. }
  3483. MovieObj_Convert(v, p_itself)
  3484.     PyObject *v;
  3485.     Movie *p_itself;
  3486. {
  3487.     if (!MovieObj_Check(v))
  3488.     {
  3489.         PyErr_SetString(PyExc_TypeError, "Movie required");
  3490.         return 0;
  3491.     }
  3492.     *p_itself = ((MovieObject *)v)->ob_itself;
  3493.     return 1;
  3494. }
  3495.  
  3496. static void MovieObj_dealloc(self)
  3497.     MovieObject *self;
  3498. {
  3499.     DisposeMovie(self->ob_itself);
  3500.     PyMem_DEL(self);
  3501. }
  3502.  
  3503. static PyObject *MovieObj_MoviesTask(_self, _args)
  3504.     MovieObject *_self;
  3505.     PyObject *_args;
  3506. {
  3507.     PyObject *_res = NULL;
  3508.     long maxMilliSecToUse;
  3509.     if (!PyArg_ParseTuple(_args, "l",
  3510.                           &maxMilliSecToUse))
  3511.         return NULL;
  3512.     MoviesTask(_self->ob_itself,
  3513.                maxMilliSecToUse);
  3514.     Py_INCREF(Py_None);
  3515.     _res = Py_None;
  3516.     return _res;
  3517. }
  3518.  
  3519. static PyObject *MovieObj_PrerollMovie(_self, _args)
  3520.     MovieObject *_self;
  3521.     PyObject *_args;
  3522. {
  3523.     PyObject *_res = NULL;
  3524.     OSErr _err;
  3525.     TimeValue time;
  3526.     Fixed Rate;
  3527.     if (!PyArg_ParseTuple(_args, "lO&",
  3528.                           &time,
  3529.                           PyMac_GetFixed, &Rate))
  3530.         return NULL;
  3531.     _err = PrerollMovie(_self->ob_itself,
  3532.                         time,
  3533.                         Rate);
  3534.     if (_err != noErr) return PyMac_Error(_err);
  3535.     Py_INCREF(Py_None);
  3536.     _res = Py_None;
  3537.     return _res;
  3538. }
  3539.  
  3540. static PyObject *MovieObj_LoadMovieIntoRam(_self, _args)
  3541.     MovieObject *_self;
  3542.     PyObject *_args;
  3543. {
  3544.     PyObject *_res = NULL;
  3545.     OSErr _err;
  3546.     TimeValue time;
  3547.     TimeValue duration;
  3548.     long flags;
  3549.     if (!PyArg_ParseTuple(_args, "lll",
  3550.                           &time,
  3551.                           &duration,
  3552.                           &flags))
  3553.         return NULL;
  3554.     _err = LoadMovieIntoRam(_self->ob_itself,
  3555.                             time,
  3556.                             duration,
  3557.                             flags);
  3558.     if (_err != noErr) return PyMac_Error(_err);
  3559.     Py_INCREF(Py_None);
  3560.     _res = Py_None;
  3561.     return _res;
  3562. }
  3563.  
  3564. static PyObject *MovieObj_SetMovieActive(_self, _args)
  3565.     MovieObject *_self;
  3566.     PyObject *_args;
  3567. {
  3568.     PyObject *_res = NULL;
  3569.     Boolean active;
  3570.     if (!PyArg_ParseTuple(_args, "b",
  3571.                           &active))
  3572.         return NULL;
  3573.     SetMovieActive(_self->ob_itself,
  3574.                    active);
  3575.     Py_INCREF(Py_None);
  3576.     _res = Py_None;
  3577.     return _res;
  3578. }
  3579.  
  3580. static PyObject *MovieObj_GetMovieActive(_self, _args)
  3581.     MovieObject *_self;
  3582.     PyObject *_args;
  3583. {
  3584.     PyObject *_res = NULL;
  3585.     Boolean _rv;
  3586.     if (!PyArg_ParseTuple(_args, ""))
  3587.         return NULL;
  3588.     _rv = GetMovieActive(_self->ob_itself);
  3589.     _res = Py_BuildValue("b",
  3590.                          _rv);
  3591.     return _res;
  3592. }
  3593.  
  3594. static PyObject *MovieObj_StartMovie(_self, _args)
  3595.     MovieObject *_self;
  3596.     PyObject *_args;
  3597. {
  3598.     PyObject *_res = NULL;
  3599.     if (!PyArg_ParseTuple(_args, ""))
  3600.         return NULL;
  3601.     StartMovie(_self->ob_itself);
  3602.     Py_INCREF(Py_None);
  3603.     _res = Py_None;
  3604.     return _res;
  3605. }
  3606.  
  3607. static PyObject *MovieObj_StopMovie(_self, _args)
  3608.     MovieObject *_self;
  3609.     PyObject *_args;
  3610. {
  3611.     PyObject *_res = NULL;
  3612.     if (!PyArg_ParseTuple(_args, ""))
  3613.         return NULL;
  3614.     StopMovie(_self->ob_itself);
  3615.     Py_INCREF(Py_None);
  3616.     _res = Py_None;
  3617.     return _res;
  3618. }
  3619.  
  3620. static PyObject *MovieObj_GoToBeginningOfMovie(_self, _args)
  3621.     MovieObject *_self;
  3622.     PyObject *_args;
  3623. {
  3624.     PyObject *_res = NULL;
  3625.     if (!PyArg_ParseTuple(_args, ""))
  3626.         return NULL;
  3627.     GoToBeginningOfMovie(_self->ob_itself);
  3628.     Py_INCREF(Py_None);
  3629.     _res = Py_None;
  3630.     return _res;
  3631. }
  3632.  
  3633. static PyObject *MovieObj_GoToEndOfMovie(_self, _args)
  3634.     MovieObject *_self;
  3635.     PyObject *_args;
  3636. {
  3637.     PyObject *_res = NULL;
  3638.     if (!PyArg_ParseTuple(_args, ""))
  3639.         return NULL;
  3640.     GoToEndOfMovie(_self->ob_itself);
  3641.     Py_INCREF(Py_None);
  3642.     _res = Py_None;
  3643.     return _res;
  3644. }
  3645.  
  3646. static PyObject *MovieObj_IsMovieDone(_self, _args)
  3647.     MovieObject *_self;
  3648.     PyObject *_args;
  3649. {
  3650.     PyObject *_res = NULL;
  3651.     Boolean _rv;
  3652.     if (!PyArg_ParseTuple(_args, ""))
  3653.         return NULL;
  3654.     _rv = IsMovieDone(_self->ob_itself);
  3655.     _res = Py_BuildValue("b",
  3656.                          _rv);
  3657.     return _res;
  3658. }
  3659.  
  3660. static PyObject *MovieObj_GetMoviePreviewMode(_self, _args)
  3661.     MovieObject *_self;
  3662.     PyObject *_args;
  3663. {
  3664.     PyObject *_res = NULL;
  3665.     Boolean _rv;
  3666.     if (!PyArg_ParseTuple(_args, ""))
  3667.         return NULL;
  3668.     _rv = GetMoviePreviewMode(_self->ob_itself);
  3669.     _res = Py_BuildValue("b",
  3670.                          _rv);
  3671.     return _res;
  3672. }
  3673.  
  3674. static PyObject *MovieObj_SetMoviePreviewMode(_self, _args)
  3675.     MovieObject *_self;
  3676.     PyObject *_args;
  3677. {
  3678.     PyObject *_res = NULL;
  3679.     Boolean usePreview;
  3680.     if (!PyArg_ParseTuple(_args, "b",
  3681.                           &usePreview))
  3682.         return NULL;
  3683.     SetMoviePreviewMode(_self->ob_itself,
  3684.                         usePreview);
  3685.     Py_INCREF(Py_None);
  3686.     _res = Py_None;
  3687.     return _res;
  3688. }
  3689.  
  3690. static PyObject *MovieObj_ShowMoviePoster(_self, _args)
  3691.     MovieObject *_self;
  3692.     PyObject *_args;
  3693. {
  3694.     PyObject *_res = NULL;
  3695.     if (!PyArg_ParseTuple(_args, ""))
  3696.         return NULL;
  3697.     ShowMoviePoster(_self->ob_itself);
  3698.     Py_INCREF(Py_None);
  3699.     _res = Py_None;
  3700.     return _res;
  3701. }
  3702.  
  3703. static PyObject *MovieObj_GetMovieTimeBase(_self, _args)
  3704.     MovieObject *_self;
  3705.     PyObject *_args;
  3706. {
  3707.     PyObject *_res = NULL;
  3708.     TimeBase _rv;
  3709.     if (!PyArg_ParseTuple(_args, ""))
  3710.         return NULL;
  3711.     _rv = GetMovieTimeBase(_self->ob_itself);
  3712.     _res = Py_BuildValue("O&",
  3713.                          TimeBaseObj_New, _rv);
  3714.     return _res;
  3715. }
  3716.  
  3717. static PyObject *MovieObj_GetNextTrackForCompositing(_self, _args)
  3718.     MovieObject *_self;
  3719.     PyObject *_args;
  3720. {
  3721.     PyObject *_res = NULL;
  3722.     Track _rv;
  3723.     Track theTrack;
  3724.     if (!PyArg_ParseTuple(_args, "O&",
  3725.                           TrackObj_Convert, &theTrack))
  3726.         return NULL;
  3727.     _rv = GetNextTrackForCompositing(_self->ob_itself,
  3728.                                      theTrack);
  3729.     _res = Py_BuildValue("O&",
  3730.                          TrackObj_New, _rv);
  3731.     return _res;
  3732. }
  3733.  
  3734. static PyObject *MovieObj_GetPrevTrackForCompositing(_self, _args)
  3735.     MovieObject *_self;
  3736.     PyObject *_args;
  3737. {
  3738.     PyObject *_res = NULL;
  3739.     Track _rv;
  3740.     Track theTrack;
  3741.     if (!PyArg_ParseTuple(_args, "O&",
  3742.                           TrackObj_Convert, &theTrack))
  3743.         return NULL;
  3744.     _rv = GetPrevTrackForCompositing(_self->ob_itself,
  3745.                                      theTrack);
  3746.     _res = Py_BuildValue("O&",
  3747.                          TrackObj_New, _rv);
  3748.     return _res;
  3749. }
  3750.  
  3751. static PyObject *MovieObj_GetMoviePict(_self, _args)
  3752.     MovieObject *_self;
  3753.     PyObject *_args;
  3754. {
  3755.     PyObject *_res = NULL;
  3756.     PicHandle _rv;
  3757.     TimeValue time;
  3758.     if (!PyArg_ParseTuple(_args, "l",
  3759.                           &time))
  3760.         return NULL;
  3761.     _rv = GetMoviePict(_self->ob_itself,
  3762.                        time);
  3763.     _res = Py_BuildValue("O&",
  3764.                          ResObj_New, _rv);
  3765.     return _res;
  3766. }
  3767.  
  3768. static PyObject *MovieObj_GetMoviePosterPict(_self, _args)
  3769.     MovieObject *_self;
  3770.     PyObject *_args;
  3771. {
  3772.     PyObject *_res = NULL;
  3773.     PicHandle _rv;
  3774.     if (!PyArg_ParseTuple(_args, ""))
  3775.         return NULL;
  3776.     _rv = GetMoviePosterPict(_self->ob_itself);
  3777.     _res = Py_BuildValue("O&",
  3778.                          ResObj_New, _rv);
  3779.     return _res;
  3780. }
  3781.  
  3782. static PyObject *MovieObj_UpdateMovie(_self, _args)
  3783.     MovieObject *_self;
  3784.     PyObject *_args;
  3785. {
  3786.     PyObject *_res = NULL;
  3787.     OSErr _err;
  3788.     if (!PyArg_ParseTuple(_args, ""))
  3789.         return NULL;
  3790.     _err = UpdateMovie(_self->ob_itself);
  3791.     if (_err != noErr) return PyMac_Error(_err);
  3792.     Py_INCREF(Py_None);
  3793.     _res = Py_None;
  3794.     return _res;
  3795. }
  3796.  
  3797. static PyObject *MovieObj_GetMovieBox(_self, _args)
  3798.     MovieObject *_self;
  3799.     PyObject *_args;
  3800. {
  3801.     PyObject *_res = NULL;
  3802.     Rect boxRect;
  3803.     if (!PyArg_ParseTuple(_args, ""))
  3804.         return NULL;
  3805.     GetMovieBox(_self->ob_itself,
  3806.                 &boxRect);
  3807.     _res = Py_BuildValue("O&",
  3808.                          PyMac_BuildRect, &boxRect);
  3809.     return _res;
  3810. }
  3811.  
  3812. static PyObject *MovieObj_SetMovieBox(_self, _args)
  3813.     MovieObject *_self;
  3814.     PyObject *_args;
  3815. {
  3816.     PyObject *_res = NULL;
  3817.     Rect boxRect;
  3818.     if (!PyArg_ParseTuple(_args, "O&",
  3819.                           PyMac_GetRect, &boxRect))
  3820.         return NULL;
  3821.     SetMovieBox(_self->ob_itself,
  3822.                 &boxRect);
  3823.     Py_INCREF(Py_None);
  3824.     _res = Py_None;
  3825.     return _res;
  3826. }
  3827.  
  3828. static PyObject *MovieObj_GetMovieDisplayClipRgn(_self, _args)
  3829.     MovieObject *_self;
  3830.     PyObject *_args;
  3831. {
  3832.     PyObject *_res = NULL;
  3833.     RgnHandle _rv;
  3834.     if (!PyArg_ParseTuple(_args, ""))
  3835.         return NULL;
  3836.     _rv = GetMovieDisplayClipRgn(_self->ob_itself);
  3837.     _res = Py_BuildValue("O&",
  3838.                          ResObj_New, _rv);
  3839.     return _res;
  3840. }
  3841.  
  3842. static PyObject *MovieObj_SetMovieDisplayClipRgn(_self, _args)
  3843.     MovieObject *_self;
  3844.     PyObject *_args;
  3845. {
  3846.     PyObject *_res = NULL;
  3847.     RgnHandle theClip;
  3848.     if (!PyArg_ParseTuple(_args, "O&",
  3849.                           ResObj_Convert, &theClip))
  3850.         return NULL;
  3851.     SetMovieDisplayClipRgn(_self->ob_itself,
  3852.                            theClip);
  3853.     Py_INCREF(Py_None);
  3854.     _res = Py_None;
  3855.     return _res;
  3856. }
  3857.  
  3858. static PyObject *MovieObj_GetMovieClipRgn(_self, _args)
  3859.     MovieObject *_self;
  3860.     PyObject *_args;
  3861. {
  3862.     PyObject *_res = NULL;
  3863.     RgnHandle _rv;
  3864.     if (!PyArg_ParseTuple(_args, ""))
  3865.         return NULL;
  3866.     _rv = GetMovieClipRgn(_self->ob_itself);
  3867.     _res = Py_BuildValue("O&",
  3868.                          ResObj_New, _rv);
  3869.     return _res;
  3870. }
  3871.  
  3872. static PyObject *MovieObj_SetMovieClipRgn(_self, _args)
  3873.     MovieObject *_self;
  3874.     PyObject *_args;
  3875. {
  3876.     PyObject *_res = NULL;
  3877.     RgnHandle theClip;
  3878.     if (!PyArg_ParseTuple(_args, "O&",
  3879.                           ResObj_Convert, &theClip))
  3880.         return NULL;
  3881.     SetMovieClipRgn(_self->ob_itself,
  3882.                     theClip);
  3883.     Py_INCREF(Py_None);
  3884.     _res = Py_None;
  3885.     return _res;
  3886. }
  3887.  
  3888. static PyObject *MovieObj_GetMovieDisplayBoundsRgn(_self, _args)
  3889.     MovieObject *_self;
  3890.     PyObject *_args;
  3891. {
  3892.     PyObject *_res = NULL;
  3893.     RgnHandle _rv;
  3894.     if (!PyArg_ParseTuple(_args, ""))
  3895.         return NULL;
  3896.     _rv = GetMovieDisplayBoundsRgn(_self->ob_itself);
  3897.     _res = Py_BuildValue("O&",
  3898.                          ResObj_New, _rv);
  3899.     return _res;
  3900. }
  3901.  
  3902. static PyObject *MovieObj_GetMovieBoundsRgn(_self, _args)
  3903.     MovieObject *_self;
  3904.     PyObject *_args;
  3905. {
  3906.     PyObject *_res = NULL;
  3907.     RgnHandle _rv;
  3908.     if (!PyArg_ParseTuple(_args, ""))
  3909.         return NULL;
  3910.     _rv = GetMovieBoundsRgn(_self->ob_itself);
  3911.     _res = Py_BuildValue("O&",
  3912.                          ResObj_New, _rv);
  3913.     return _res;
  3914. }
  3915.  
  3916. static PyObject *MovieObj_PutMovieIntoHandle(_self, _args)
  3917.     MovieObject *_self;
  3918.     PyObject *_args;
  3919. {
  3920.     PyObject *_res = NULL;
  3921.     OSErr _err;
  3922.     Handle publicMovie;
  3923.     if (!PyArg_ParseTuple(_args, "O&",
  3924.                           ResObj_Convert, &publicMovie))
  3925.         return NULL;
  3926.     _err = PutMovieIntoHandle(_self->ob_itself,
  3927.                               publicMovie);
  3928.     if (_err != noErr) return PyMac_Error(_err);
  3929.     Py_INCREF(Py_None);
  3930.     _res = Py_None;
  3931.     return _res;
  3932. }
  3933.  
  3934. static PyObject *MovieObj_PutMovieIntoDataFork(_self, _args)
  3935.     MovieObject *_self;
  3936.     PyObject *_args;
  3937. {
  3938.     PyObject *_res = NULL;
  3939.     OSErr _err;
  3940.     short fRefNum;
  3941.     long offset;
  3942.     long maxSize;
  3943.     if (!PyArg_ParseTuple(_args, "hll",
  3944.                           &fRefNum,
  3945.                           &offset,
  3946.                           &maxSize))
  3947.         return NULL;
  3948.     _err = PutMovieIntoDataFork(_self->ob_itself,
  3949.                                 fRefNum,
  3950.                                 offset,
  3951.                                 maxSize);
  3952.     if (_err != noErr) return PyMac_Error(_err);
  3953.     Py_INCREF(Py_None);
  3954.     _res = Py_None;
  3955.     return _res;
  3956. }
  3957.  
  3958. static PyObject *MovieObj_GetMovieTimeScale(_self, _args)
  3959.     MovieObject *_self;
  3960.     PyObject *_args;
  3961. {
  3962.     PyObject *_res = NULL;
  3963.     TimeScale _rv;
  3964.     if (!PyArg_ParseTuple(_args, ""))
  3965.         return NULL;
  3966.     _rv = GetMovieTimeScale(_self->ob_itself);
  3967.     _res = Py_BuildValue("l",
  3968.                          _rv);
  3969.     return _res;
  3970. }
  3971.  
  3972. static PyObject *MovieObj_SetMovieTimeScale(_self, _args)
  3973.     MovieObject *_self;
  3974.     PyObject *_args;
  3975. {
  3976.     PyObject *_res = NULL;
  3977.     TimeScale timeScale;
  3978.     if (!PyArg_ParseTuple(_args, "l",
  3979.                           &timeScale))
  3980.         return NULL;
  3981.     SetMovieTimeScale(_self->ob_itself,
  3982.                       timeScale);
  3983.     Py_INCREF(Py_None);
  3984.     _res = Py_None;
  3985.     return _res;
  3986. }
  3987.  
  3988. static PyObject *MovieObj_GetMovieDuration(_self, _args)
  3989.     MovieObject *_self;
  3990.     PyObject *_args;
  3991. {
  3992.     PyObject *_res = NULL;
  3993.     TimeValue _rv;
  3994.     if (!PyArg_ParseTuple(_args, ""))
  3995.         return NULL;
  3996.     _rv = GetMovieDuration(_self->ob_itself);
  3997.     _res = Py_BuildValue("l",
  3998.                          _rv);
  3999.     return _res;
  4000. }
  4001.  
  4002. static PyObject *MovieObj_GetMovieRate(_self, _args)
  4003.     MovieObject *_self;
  4004.     PyObject *_args;
  4005. {
  4006.     PyObject *_res = NULL;
  4007.     Fixed _rv;
  4008.     if (!PyArg_ParseTuple(_args, ""))
  4009.         return NULL;
  4010.     _rv = GetMovieRate(_self->ob_itself);
  4011.     _res = Py_BuildValue("O&",
  4012.                          PyMac_BuildFixed, _rv);
  4013.     return _res;
  4014. }
  4015.  
  4016. static PyObject *MovieObj_SetMovieRate(_self, _args)
  4017.     MovieObject *_self;
  4018.     PyObject *_args;
  4019. {
  4020.     PyObject *_res = NULL;
  4021.     Fixed rate;
  4022.     if (!PyArg_ParseTuple(_args, "O&",
  4023.                           PyMac_GetFixed, &rate))
  4024.         return NULL;
  4025.     SetMovieRate(_self->ob_itself,
  4026.                  rate);
  4027.     Py_INCREF(Py_None);
  4028.     _res = Py_None;
  4029.     return _res;
  4030. }
  4031.  
  4032. static PyObject *MovieObj_GetMoviePreferredRate(_self, _args)
  4033.     MovieObject *_self;
  4034.     PyObject *_args;
  4035. {
  4036.     PyObject *_res = NULL;
  4037.     Fixed _rv;
  4038.     if (!PyArg_ParseTuple(_args, ""))
  4039.         return NULL;
  4040.     _rv = GetMoviePreferredRate(_self->ob_itself);
  4041.     _res = Py_BuildValue("O&",
  4042.                          PyMac_BuildFixed, _rv);
  4043.     return _res;
  4044. }
  4045.  
  4046. static PyObject *MovieObj_SetMoviePreferredRate(_self, _args)
  4047.     MovieObject *_self;
  4048.     PyObject *_args;
  4049. {
  4050.     PyObject *_res = NULL;
  4051.     Fixed rate;
  4052.     if (!PyArg_ParseTuple(_args, "O&",
  4053.                           PyMac_GetFixed, &rate))
  4054.         return NULL;
  4055.     SetMoviePreferredRate(_self->ob_itself,
  4056.                           rate);
  4057.     Py_INCREF(Py_None);
  4058.     _res = Py_None;
  4059.     return _res;
  4060. }
  4061.  
  4062. static PyObject *MovieObj_GetMoviePreferredVolume(_self, _args)
  4063.     MovieObject *_self;
  4064.     PyObject *_args;
  4065. {
  4066.     PyObject *_res = NULL;
  4067.     short _rv;
  4068.     if (!PyArg_ParseTuple(_args, ""))
  4069.         return NULL;
  4070.     _rv = GetMoviePreferredVolume(_self->ob_itself);
  4071.     _res = Py_BuildValue("h",
  4072.                          _rv);
  4073.     return _res;
  4074. }
  4075.  
  4076. static PyObject *MovieObj_SetMoviePreferredVolume(_self, _args)
  4077.     MovieObject *_self;
  4078.     PyObject *_args;
  4079. {
  4080.     PyObject *_res = NULL;
  4081.     short volume;
  4082.     if (!PyArg_ParseTuple(_args, "h",
  4083.                           &volume))
  4084.         return NULL;
  4085.     SetMoviePreferredVolume(_self->ob_itself,
  4086.                             volume);
  4087.     Py_INCREF(Py_None);
  4088.     _res = Py_None;
  4089.     return _res;
  4090. }
  4091.  
  4092. static PyObject *MovieObj_GetMovieVolume(_self, _args)
  4093.     MovieObject *_self;
  4094.     PyObject *_args;
  4095. {
  4096.     PyObject *_res = NULL;
  4097.     short _rv;
  4098.     if (!PyArg_ParseTuple(_args, ""))
  4099.         return NULL;
  4100.     _rv = GetMovieVolume(_self->ob_itself);
  4101.     _res = Py_BuildValue("h",
  4102.                          _rv);
  4103.     return _res;
  4104. }
  4105.  
  4106. static PyObject *MovieObj_SetMovieVolume(_self, _args)
  4107.     MovieObject *_self;
  4108.     PyObject *_args;
  4109. {
  4110.     PyObject *_res = NULL;
  4111.     short volume;
  4112.     if (!PyArg_ParseTuple(_args, "h",
  4113.                           &volume))
  4114.         return NULL;
  4115.     SetMovieVolume(_self->ob_itself,
  4116.                    volume);
  4117.     Py_INCREF(Py_None);
  4118.     _res = Py_None;
  4119.     return _res;
  4120. }
  4121.  
  4122. static PyObject *MovieObj_GetMoviePreviewTime(_self, _args)
  4123.     MovieObject *_self;
  4124.     PyObject *_args;
  4125. {
  4126.     PyObject *_res = NULL;
  4127.     TimeValue previewTime;
  4128.     TimeValue previewDuration;
  4129.     if (!PyArg_ParseTuple(_args, ""))
  4130.         return NULL;
  4131.     GetMoviePreviewTime(_self->ob_itself,
  4132.                         &previewTime,
  4133.                         &previewDuration);
  4134.     _res = Py_BuildValue("ll",
  4135.                          previewTime,
  4136.                          previewDuration);
  4137.     return _res;
  4138. }
  4139.  
  4140. static PyObject *MovieObj_SetMoviePreviewTime(_self, _args)
  4141.     MovieObject *_self;
  4142.     PyObject *_args;
  4143. {
  4144.     PyObject *_res = NULL;
  4145.     TimeValue previewTime;
  4146.     TimeValue previewDuration;
  4147.     if (!PyArg_ParseTuple(_args, "ll",
  4148.                           &previewTime,
  4149.                           &previewDuration))
  4150.         return NULL;
  4151.     SetMoviePreviewTime(_self->ob_itself,
  4152.                         previewTime,
  4153.                         previewDuration);
  4154.     Py_INCREF(Py_None);
  4155.     _res = Py_None;
  4156.     return _res;
  4157. }
  4158.  
  4159. static PyObject *MovieObj_GetMoviePosterTime(_self, _args)
  4160.     MovieObject *_self;
  4161.     PyObject *_args;
  4162. {
  4163.     PyObject *_res = NULL;
  4164.     TimeValue _rv;
  4165.     if (!PyArg_ParseTuple(_args, ""))
  4166.         return NULL;
  4167.     _rv = GetMoviePosterTime(_self->ob_itself);
  4168.     _res = Py_BuildValue("l",
  4169.                          _rv);
  4170.     return _res;
  4171. }
  4172.  
  4173. static PyObject *MovieObj_SetMoviePosterTime(_self, _args)
  4174.     MovieObject *_self;
  4175.     PyObject *_args;
  4176. {
  4177.     PyObject *_res = NULL;
  4178.     TimeValue posterTime;
  4179.     if (!PyArg_ParseTuple(_args, "l",
  4180.                           &posterTime))
  4181.         return NULL;
  4182.     SetMoviePosterTime(_self->ob_itself,
  4183.                        posterTime);
  4184.     Py_INCREF(Py_None);
  4185.     _res = Py_None;
  4186.     return _res;
  4187. }
  4188.  
  4189. static PyObject *MovieObj_GetMovieSelection(_self, _args)
  4190.     MovieObject *_self;
  4191.     PyObject *_args;
  4192. {
  4193.     PyObject *_res = NULL;
  4194.     TimeValue selectionTime;
  4195.     TimeValue selectionDuration;
  4196.     if (!PyArg_ParseTuple(_args, ""))
  4197.         return NULL;
  4198.     GetMovieSelection(_self->ob_itself,
  4199.                       &selectionTime,
  4200.                       &selectionDuration);
  4201.     _res = Py_BuildValue("ll",
  4202.                          selectionTime,
  4203.                          selectionDuration);
  4204.     return _res;
  4205. }
  4206.  
  4207. static PyObject *MovieObj_SetMovieSelection(_self, _args)
  4208.     MovieObject *_self;
  4209.     PyObject *_args;
  4210. {
  4211.     PyObject *_res = NULL;
  4212.     TimeValue selectionTime;
  4213.     TimeValue selectionDuration;
  4214.     if (!PyArg_ParseTuple(_args, "ll",
  4215.                           &selectionTime,
  4216.                           &selectionDuration))
  4217.         return NULL;
  4218.     SetMovieSelection(_self->ob_itself,
  4219.                       selectionTime,
  4220.                       selectionDuration);
  4221.     Py_INCREF(Py_None);
  4222.     _res = Py_None;
  4223.     return _res;
  4224. }
  4225.  
  4226. static PyObject *MovieObj_SetMovieActiveSegment(_self, _args)
  4227.     MovieObject *_self;
  4228.     PyObject *_args;
  4229. {
  4230.     PyObject *_res = NULL;
  4231.     TimeValue startTime;
  4232.     TimeValue duration;
  4233.     if (!PyArg_ParseTuple(_args, "ll",
  4234.                           &startTime,
  4235.                           &duration))
  4236.         return NULL;
  4237.     SetMovieActiveSegment(_self->ob_itself,
  4238.                           startTime,
  4239.                           duration);
  4240.     Py_INCREF(Py_None);
  4241.     _res = Py_None;
  4242.     return _res;
  4243. }
  4244.  
  4245. static PyObject *MovieObj_GetMovieActiveSegment(_self, _args)
  4246.     MovieObject *_self;
  4247.     PyObject *_args;
  4248. {
  4249.     PyObject *_res = NULL;
  4250.     TimeValue startTime;
  4251.     TimeValue duration;
  4252.     if (!PyArg_ParseTuple(_args, ""))
  4253.         return NULL;
  4254.     GetMovieActiveSegment(_self->ob_itself,
  4255.                           &startTime,
  4256.                           &duration);
  4257.     _res = Py_BuildValue("ll",
  4258.                          startTime,
  4259.                          duration);
  4260.     return _res;
  4261. }
  4262.  
  4263. static PyObject *MovieObj_SetMovieTimeValue(_self, _args)
  4264.     MovieObject *_self;
  4265.     PyObject *_args;
  4266. {
  4267.     PyObject *_res = NULL;
  4268.     TimeValue newtime;
  4269.     if (!PyArg_ParseTuple(_args, "l",
  4270.                           &newtime))
  4271.         return NULL;
  4272.     SetMovieTimeValue(_self->ob_itself,
  4273.                       newtime);
  4274.     Py_INCREF(Py_None);
  4275.     _res = Py_None;
  4276.     return _res;
  4277. }
  4278.  
  4279. static PyObject *MovieObj_GetMovieUserData(_self, _args)
  4280.     MovieObject *_self;
  4281.     PyObject *_args;
  4282. {
  4283.     PyObject *_res = NULL;
  4284.     UserData _rv;
  4285.     if (!PyArg_ParseTuple(_args, ""))
  4286.         return NULL;
  4287.     _rv = GetMovieUserData(_self->ob_itself);
  4288.     _res = Py_BuildValue("O&",
  4289.                          UserDataObj_New, _rv);
  4290.     return _res;
  4291. }
  4292.  
  4293. static PyObject *MovieObj_GetMovieTrackCount(_self, _args)
  4294.     MovieObject *_self;
  4295.     PyObject *_args;
  4296. {
  4297.     PyObject *_res = NULL;
  4298.     long _rv;
  4299.     if (!PyArg_ParseTuple(_args, ""))
  4300.         return NULL;
  4301.     _rv = GetMovieTrackCount(_self->ob_itself);
  4302.     _res = Py_BuildValue("l",
  4303.                          _rv);
  4304.     return _res;
  4305. }
  4306.  
  4307. static PyObject *MovieObj_GetMovieTrack(_self, _args)
  4308.     MovieObject *_self;
  4309.     PyObject *_args;
  4310. {
  4311.     PyObject *_res = NULL;
  4312.     Track _rv;
  4313.     long trackID;
  4314.     if (!PyArg_ParseTuple(_args, "l",
  4315.                           &trackID))
  4316.         return NULL;
  4317.     _rv = GetMovieTrack(_self->ob_itself,
  4318.                         trackID);
  4319.     _res = Py_BuildValue("O&",
  4320.                          TrackObj_New, _rv);
  4321.     return _res;
  4322. }
  4323.  
  4324. static PyObject *MovieObj_GetMovieIndTrack(_self, _args)
  4325.     MovieObject *_self;
  4326.     PyObject *_args;
  4327. {
  4328.     PyObject *_res = NULL;
  4329.     Track _rv;
  4330.     long index;
  4331.     if (!PyArg_ParseTuple(_args, "l",
  4332.                           &index))
  4333.         return NULL;
  4334.     _rv = GetMovieIndTrack(_self->ob_itself,
  4335.                            index);
  4336.     _res = Py_BuildValue("O&",
  4337.                          TrackObj_New, _rv);
  4338.     return _res;
  4339. }
  4340.  
  4341. static PyObject *MovieObj_GetMovieIndTrackType(_self, _args)
  4342.     MovieObject *_self;
  4343.     PyObject *_args;
  4344. {
  4345.     PyObject *_res = NULL;
  4346.     Track _rv;
  4347.     long index;
  4348.     OSType trackType;
  4349.     long flags;
  4350.     if (!PyArg_ParseTuple(_args, "lO&l",
  4351.                           &index,
  4352.                           PyMac_GetOSType, &trackType,
  4353.                           &flags))
  4354.         return NULL;
  4355.     _rv = GetMovieIndTrackType(_self->ob_itself,
  4356.                                index,
  4357.                                trackType,
  4358.                                flags);
  4359.     _res = Py_BuildValue("O&",
  4360.                          TrackObj_New, _rv);
  4361.     return _res;
  4362. }
  4363.  
  4364. static PyObject *MovieObj_NewMovieTrack(_self, _args)
  4365.     MovieObject *_self;
  4366.     PyObject *_args;
  4367. {
  4368.     PyObject *_res = NULL;
  4369.     Track _rv;
  4370.     Fixed width;
  4371.     Fixed height;
  4372.     short trackVolume;
  4373.     if (!PyArg_ParseTuple(_args, "O&O&h",
  4374.                           PyMac_GetFixed, &width,
  4375.                           PyMac_GetFixed, &height,
  4376.                           &trackVolume))
  4377.         return NULL;
  4378.     _rv = NewMovieTrack(_self->ob_itself,
  4379.                         width,
  4380.                         height,
  4381.                         trackVolume);
  4382.     _res = Py_BuildValue("O&",
  4383.                          TrackObj_New, _rv);
  4384.     return _res;
  4385. }
  4386.  
  4387. static PyObject *MovieObj_SetAutoTrackAlternatesEnabled(_self, _args)
  4388.     MovieObject *_self;
  4389.     PyObject *_args;
  4390. {
  4391.     PyObject *_res = NULL;
  4392.     Boolean enable;
  4393.     if (!PyArg_ParseTuple(_args, "b",
  4394.                           &enable))
  4395.         return NULL;
  4396.     SetAutoTrackAlternatesEnabled(_self->ob_itself,
  4397.                                   enable);
  4398.     Py_INCREF(Py_None);
  4399.     _res = Py_None;
  4400.     return _res;
  4401. }
  4402.  
  4403. static PyObject *MovieObj_SelectMovieAlternates(_self, _args)
  4404.     MovieObject *_self;
  4405.     PyObject *_args;
  4406. {
  4407.     PyObject *_res = NULL;
  4408.     if (!PyArg_ParseTuple(_args, ""))
  4409.         return NULL;
  4410.     SelectMovieAlternates(_self->ob_itself);
  4411.     Py_INCREF(Py_None);
  4412.     _res = Py_None;
  4413.     return _res;
  4414. }
  4415.  
  4416. static PyObject *MovieObj_InsertMovieSegment(_self, _args)
  4417.     MovieObject *_self;
  4418.     PyObject *_args;
  4419. {
  4420.     PyObject *_res = NULL;
  4421.     OSErr _err;
  4422.     Movie dstMovie;
  4423.     TimeValue srcIn;
  4424.     TimeValue srcDuration;
  4425.     TimeValue dstIn;
  4426.     if (!PyArg_ParseTuple(_args, "O&lll",
  4427.                           MovieObj_Convert, &dstMovie,
  4428.                           &srcIn,
  4429.                           &srcDuration,
  4430.                           &dstIn))
  4431.         return NULL;
  4432.     _err = InsertMovieSegment(_self->ob_itself,
  4433.                               dstMovie,
  4434.                               srcIn,
  4435.                               srcDuration,
  4436.                               dstIn);
  4437.     if (_err != noErr) return PyMac_Error(_err);
  4438.     Py_INCREF(Py_None);
  4439.     _res = Py_None;
  4440.     return _res;
  4441. }
  4442.  
  4443. static PyObject *MovieObj_InsertEmptyMovieSegment(_self, _args)
  4444.     MovieObject *_self;
  4445.     PyObject *_args;
  4446. {
  4447.     PyObject *_res = NULL;
  4448.     OSErr _err;
  4449.     TimeValue dstIn;
  4450.     TimeValue dstDuration;
  4451.     if (!PyArg_ParseTuple(_args, "ll",
  4452.                           &dstIn,
  4453.                           &dstDuration))
  4454.         return NULL;
  4455.     _err = InsertEmptyMovieSegment(_self->ob_itself,
  4456.                                    dstIn,
  4457.                                    dstDuration);
  4458.     if (_err != noErr) return PyMac_Error(_err);
  4459.     Py_INCREF(Py_None);
  4460.     _res = Py_None;
  4461.     return _res;
  4462. }
  4463.  
  4464. static PyObject *MovieObj_DeleteMovieSegment(_self, _args)
  4465.     MovieObject *_self;
  4466.     PyObject *_args;
  4467. {
  4468.     PyObject *_res = NULL;
  4469.     OSErr _err;
  4470.     TimeValue startTime;
  4471.     TimeValue duration;
  4472.     if (!PyArg_ParseTuple(_args, "ll",
  4473.                           &startTime,
  4474.                           &duration))
  4475.         return NULL;
  4476.     _err = DeleteMovieSegment(_self->ob_itself,
  4477.                               startTime,
  4478.                               duration);
  4479.     if (_err != noErr) return PyMac_Error(_err);
  4480.     Py_INCREF(Py_None);
  4481.     _res = Py_None;
  4482.     return _res;
  4483. }
  4484.  
  4485. static PyObject *MovieObj_ScaleMovieSegment(_self, _args)
  4486.     MovieObject *_self;
  4487.     PyObject *_args;
  4488. {
  4489.     PyObject *_res = NULL;
  4490.     OSErr _err;
  4491.     TimeValue startTime;
  4492.     TimeValue oldDuration;
  4493.     TimeValue newDuration;
  4494.     if (!PyArg_ParseTuple(_args, "lll",
  4495.                           &startTime,
  4496.                           &oldDuration,
  4497.                           &newDuration))
  4498.         return NULL;
  4499.     _err = ScaleMovieSegment(_self->ob_itself,
  4500.                              startTime,
  4501.                              oldDuration,
  4502.                              newDuration);
  4503.     if (_err != noErr) return PyMac_Error(_err);
  4504.     Py_INCREF(Py_None);
  4505.     _res = Py_None;
  4506.     return _res;
  4507. }
  4508.  
  4509. static PyObject *MovieObj_CutMovieSelection(_self, _args)
  4510.     MovieObject *_self;
  4511.     PyObject *_args;
  4512. {
  4513.     PyObject *_res = NULL;
  4514.     Movie _rv;
  4515.     if (!PyArg_ParseTuple(_args, ""))
  4516.         return NULL;
  4517.     _rv = CutMovieSelection(_self->ob_itself);
  4518.     _res = Py_BuildValue("O&",
  4519.                          MovieObj_New, _rv);
  4520.     return _res;
  4521. }
  4522.  
  4523. static PyObject *MovieObj_CopyMovieSelection(_self, _args)
  4524.     MovieObject *_self;
  4525.     PyObject *_args;
  4526. {
  4527.     PyObject *_res = NULL;
  4528.     Movie _rv;
  4529.     if (!PyArg_ParseTuple(_args, ""))
  4530.         return NULL;
  4531.     _rv = CopyMovieSelection(_self->ob_itself);
  4532.     _res = Py_BuildValue("O&",
  4533.                          MovieObj_New, _rv);
  4534.     return _res;
  4535. }
  4536.  
  4537. static PyObject *MovieObj_PasteMovieSelection(_self, _args)
  4538.     MovieObject *_self;
  4539.     PyObject *_args;
  4540. {
  4541.     PyObject *_res = NULL;
  4542.     Movie src;
  4543.     if (!PyArg_ParseTuple(_args, "O&",
  4544.                           MovieObj_Convert, &src))
  4545.         return NULL;
  4546.     PasteMovieSelection(_self->ob_itself,
  4547.                         src);
  4548.     Py_INCREF(Py_None);
  4549.     _res = Py_None;
  4550.     return _res;
  4551. }
  4552.  
  4553. static PyObject *MovieObj_AddMovieSelection(_self, _args)
  4554.     MovieObject *_self;
  4555.     PyObject *_args;
  4556. {
  4557.     PyObject *_res = NULL;
  4558.     Movie src;
  4559.     if (!PyArg_ParseTuple(_args, "O&",
  4560.                           MovieObj_Convert, &src))
  4561.         return NULL;
  4562.     AddMovieSelection(_self->ob_itself,
  4563.                       src);
  4564.     Py_INCREF(Py_None);
  4565.     _res = Py_None;
  4566.     return _res;
  4567. }
  4568.  
  4569. static PyObject *MovieObj_ClearMovieSelection(_self, _args)
  4570.     MovieObject *_self;
  4571.     PyObject *_args;
  4572. {
  4573.     PyObject *_res = NULL;
  4574.     if (!PyArg_ParseTuple(_args, ""))
  4575.         return NULL;
  4576.     ClearMovieSelection(_self->ob_itself);
  4577.     Py_INCREF(Py_None);
  4578.     _res = Py_None;
  4579.     return _res;
  4580. }
  4581.  
  4582. static PyObject *MovieObj_PutMovieIntoTypedHandle(_self, _args)
  4583.     MovieObject *_self;
  4584.     PyObject *_args;
  4585. {
  4586.     PyObject *_res = NULL;
  4587.     OSErr _err;
  4588.     Track targetTrack;
  4589.     OSType handleType;
  4590.     Handle publicMovie;
  4591.     TimeValue start;
  4592.     TimeValue dur;
  4593.     long flags;
  4594.     ComponentInstance userComp;
  4595.     if (!PyArg_ParseTuple(_args, "O&O&O&lllO&",
  4596.                           TrackObj_Convert, &targetTrack,
  4597.                           PyMac_GetOSType, &handleType,
  4598.                           ResObj_Convert, &publicMovie,
  4599.                           &start,
  4600.                           &dur,
  4601.                           &flags,
  4602.                           CmpInstObj_Convert, &userComp))
  4603.         return NULL;
  4604.     _err = PutMovieIntoTypedHandle(_self->ob_itself,
  4605.                                    targetTrack,
  4606.                                    handleType,
  4607.                                    publicMovie,
  4608.                                    start,
  4609.                                    dur,
  4610.                                    flags,
  4611.                                    userComp);
  4612.     if (_err != noErr) return PyMac_Error(_err);
  4613.     Py_INCREF(Py_None);
  4614.     _res = Py_None;
  4615.     return _res;
  4616. }
  4617.  
  4618. static PyObject *MovieObj_CopyMovieSettings(_self, _args)
  4619.     MovieObject *_self;
  4620.     PyObject *_args;
  4621. {
  4622.     PyObject *_res = NULL;
  4623.     OSErr _err;
  4624.     Movie dstMovie;
  4625.     if (!PyArg_ParseTuple(_args, "O&",
  4626.                           MovieObj_Convert, &dstMovie))
  4627.         return NULL;
  4628.     _err = CopyMovieSettings(_self->ob_itself,
  4629.                              dstMovie);
  4630.     if (_err != noErr) return PyMac_Error(_err);
  4631.     Py_INCREF(Py_None);
  4632.     _res = Py_None;
  4633.     return _res;
  4634. }
  4635.  
  4636. static PyObject *MovieObj_ConvertMovieToFile(_self, _args)
  4637.     MovieObject *_self;
  4638.     PyObject *_args;
  4639. {
  4640.     PyObject *_res = NULL;
  4641.     OSErr _err;
  4642.     Track onlyTrack;
  4643.     FSSpec outputFile;
  4644.     OSType fileType;
  4645.     OSType creator;
  4646.     ScriptCode scriptTag;
  4647.     short resID;
  4648.     long flags;
  4649.     ComponentInstance userComp;
  4650.     if (!PyArg_ParseTuple(_args, "O&O&O&O&hlO&",
  4651.                           TrackObj_Convert, &onlyTrack,
  4652.                           PyMac_GetFSSpec, &outputFile,
  4653.                           PyMac_GetOSType, &fileType,
  4654.                           PyMac_GetOSType, &creator,
  4655.                           &scriptTag,
  4656.                           &flags,
  4657.                           CmpInstObj_Convert, &userComp))
  4658.         return NULL;
  4659.     _err = ConvertMovieToFile(_self->ob_itself,
  4660.                               onlyTrack,
  4661.                               &outputFile,
  4662.                               fileType,
  4663.                               creator,
  4664.                               scriptTag,
  4665.                               &resID,
  4666.                               flags,
  4667.                               userComp);
  4668.     if (_err != noErr) return PyMac_Error(_err);
  4669.     _res = Py_BuildValue("h",
  4670.                          resID);
  4671.     return _res;
  4672. }
  4673.  
  4674. static PyObject *MovieObj_GetMovieDataSize(_self, _args)
  4675.     MovieObject *_self;
  4676.     PyObject *_args;
  4677. {
  4678.     PyObject *_res = NULL;
  4679.     long _rv;
  4680.     TimeValue startTime;
  4681.     TimeValue duration;
  4682.     if (!PyArg_ParseTuple(_args, "ll",
  4683.                           &startTime,
  4684.                           &duration))
  4685.         return NULL;
  4686.     _rv = GetMovieDataSize(_self->ob_itself,
  4687.                            startTime,
  4688.                            duration);
  4689.     _res = Py_BuildValue("l",
  4690.                          _rv);
  4691.     return _res;
  4692. }
  4693.  
  4694. static PyObject *MovieObj_PtInMovie(_self, _args)
  4695.     MovieObject *_self;
  4696.     PyObject *_args;
  4697. {
  4698.     PyObject *_res = NULL;
  4699.     Boolean _rv;
  4700.     Point pt;
  4701.     if (!PyArg_ParseTuple(_args, "O&",
  4702.                           PyMac_GetPoint, &pt))
  4703.         return NULL;
  4704.     _rv = PtInMovie(_self->ob_itself,
  4705.                     pt);
  4706.     _res = Py_BuildValue("b",
  4707.                          _rv);
  4708.     return _res;
  4709. }
  4710.  
  4711. static PyObject *MovieObj_SetMovieLanguage(_self, _args)
  4712.     MovieObject *_self;
  4713.     PyObject *_args;
  4714. {
  4715.     PyObject *_res = NULL;
  4716.     long language;
  4717.     if (!PyArg_ParseTuple(_args, "l",
  4718.                           &language))
  4719.         return NULL;
  4720.     SetMovieLanguage(_self->ob_itself,
  4721.                      language);
  4722.     Py_INCREF(Py_None);
  4723.     _res = Py_None;
  4724.     return _res;
  4725. }
  4726.  
  4727. static PyObject *MovieObj_GetMovieNextInterestingTime(_self, _args)
  4728.     MovieObject *_self;
  4729.     PyObject *_args;
  4730. {
  4731.     PyObject *_res = NULL;
  4732.     short interestingTimeFlags;
  4733.     short numMediaTypes;
  4734.     OSType whichMediaTypes;
  4735.     TimeValue time;
  4736.     Fixed rate;
  4737.     TimeValue interestingTime;
  4738.     TimeValue interestingDuration;
  4739.     if (!PyArg_ParseTuple(_args, "hhO&lO&",
  4740.                           &interestingTimeFlags,
  4741.                           &numMediaTypes,
  4742.                           PyMac_GetOSType, &whichMediaTypes,
  4743.                           &time,
  4744.                           PyMac_GetFixed, &rate))
  4745.         return NULL;
  4746.     GetMovieNextInterestingTime(_self->ob_itself,
  4747.                                 interestingTimeFlags,
  4748.                                 numMediaTypes,
  4749.                                 &whichMediaTypes,
  4750.                                 time,
  4751.                                 rate,
  4752.                                 &interestingTime,
  4753.                                 &interestingDuration);
  4754.     _res = Py_BuildValue("ll",
  4755.                          interestingTime,
  4756.                          interestingDuration);
  4757.     return _res;
  4758. }
  4759.  
  4760. static PyObject *MovieObj_AddMovieResource(_self, _args)
  4761.     MovieObject *_self;
  4762.     PyObject *_args;
  4763. {
  4764.     PyObject *_res = NULL;
  4765.     OSErr _err;
  4766.     short resRefNum;
  4767.     short resId;
  4768.     Str255 resName;
  4769.     if (!PyArg_ParseTuple(_args, "hO&",
  4770.                           &resRefNum,
  4771.                           PyMac_GetStr255, resName))
  4772.         return NULL;
  4773.     _err = AddMovieResource(_self->ob_itself,
  4774.                             resRefNum,
  4775.                             &resId,
  4776.                             resName);
  4777.     if (_err != noErr) return PyMac_Error(_err);
  4778.     _res = Py_BuildValue("h",
  4779.                          resId);
  4780.     return _res;
  4781. }
  4782.  
  4783. static PyObject *MovieObj_UpdateMovieResource(_self, _args)
  4784.     MovieObject *_self;
  4785.     PyObject *_args;
  4786. {
  4787.     PyObject *_res = NULL;
  4788.     OSErr _err;
  4789.     short resRefNum;
  4790.     short resId;
  4791.     Str255 resName;
  4792.     if (!PyArg_ParseTuple(_args, "hhO&",
  4793.                           &resRefNum,
  4794.                           &resId,
  4795.                           PyMac_GetStr255, resName))
  4796.         return NULL;
  4797.     _err = UpdateMovieResource(_self->ob_itself,
  4798.                                resRefNum,
  4799.                                resId,
  4800.                                resName);
  4801.     if (_err != noErr) return PyMac_Error(_err);
  4802.     Py_INCREF(Py_None);
  4803.     _res = Py_None;
  4804.     return _res;
  4805. }
  4806.  
  4807. static PyObject *MovieObj_HasMovieChanged(_self, _args)
  4808.     MovieObject *_self;
  4809.     PyObject *_args;
  4810. {
  4811.     PyObject *_res = NULL;
  4812.     Boolean _rv;
  4813.     if (!PyArg_ParseTuple(_args, ""))
  4814.         return NULL;
  4815.     _rv = HasMovieChanged(_self->ob_itself);
  4816.     _res = Py_BuildValue("b",
  4817.                          _rv);
  4818.     return _res;
  4819. }
  4820.  
  4821. static PyObject *MovieObj_ClearMovieChanged(_self, _args)
  4822.     MovieObject *_self;
  4823.     PyObject *_args;
  4824. {
  4825.     PyObject *_res = NULL;
  4826.     if (!PyArg_ParseTuple(_args, ""))
  4827.         return NULL;
  4828.     ClearMovieChanged(_self->ob_itself);
  4829.     Py_INCREF(Py_None);
  4830.     _res = Py_None;
  4831.     return _res;
  4832. }
  4833.  
  4834. static PyObject *MovieObj_SetMovieDefaultDataRef(_self, _args)
  4835.     MovieObject *_self;
  4836.     PyObject *_args;
  4837. {
  4838.     PyObject *_res = NULL;
  4839.     OSErr _err;
  4840.     Handle dataRef;
  4841.     OSType dataRefType;
  4842.     if (!PyArg_ParseTuple(_args, "O&O&",
  4843.                           ResObj_Convert, &dataRef,
  4844.                           PyMac_GetOSType, &dataRefType))
  4845.         return NULL;
  4846.     _err = SetMovieDefaultDataRef(_self->ob_itself,
  4847.                                   dataRef,
  4848.                                   dataRefType);
  4849.     if (_err != noErr) return PyMac_Error(_err);
  4850.     Py_INCREF(Py_None);
  4851.     _res = Py_None;
  4852.     return _res;
  4853. }
  4854.  
  4855. static PyObject *MovieObj_GetMovieDefaultDataRef(_self, _args)
  4856.     MovieObject *_self;
  4857.     PyObject *_args;
  4858. {
  4859.     PyObject *_res = NULL;
  4860.     OSErr _err;
  4861.     Handle dataRef;
  4862.     OSType dataRefType;
  4863.     if (!PyArg_ParseTuple(_args, ""))
  4864.         return NULL;
  4865.     _err = GetMovieDefaultDataRef(_self->ob_itself,
  4866.                                   &dataRef,
  4867.                                   &dataRefType);
  4868.     if (_err != noErr) return PyMac_Error(_err);
  4869.     _res = Py_BuildValue("O&O&",
  4870.                          ResObj_New, dataRef,
  4871.                          PyMac_BuildOSType, dataRefType);
  4872.     return _res;
  4873. }
  4874.  
  4875. static PyObject *MovieObj_SetMovieColorTable(_self, _args)
  4876.     MovieObject *_self;
  4877.     PyObject *_args;
  4878. {
  4879.     PyObject *_res = NULL;
  4880.     OSErr _err;
  4881.     CTabHandle ctab;
  4882.     if (!PyArg_ParseTuple(_args, "O&",
  4883.                           ResObj_Convert, &ctab))
  4884.         return NULL;
  4885.     _err = SetMovieColorTable(_self->ob_itself,
  4886.                               ctab);
  4887.     if (_err != noErr) return PyMac_Error(_err);
  4888.     Py_INCREF(Py_None);
  4889.     _res = Py_None;
  4890.     return _res;
  4891. }
  4892.  
  4893. static PyObject *MovieObj_GetMovieColorTable(_self, _args)
  4894.     MovieObject *_self;
  4895.     PyObject *_args;
  4896. {
  4897.     PyObject *_res = NULL;
  4898.     OSErr _err;
  4899.     CTabHandle ctab;
  4900.     if (!PyArg_ParseTuple(_args, ""))
  4901.         return NULL;
  4902.     _err = GetMovieColorTable(_self->ob_itself,
  4903.                               &ctab);
  4904.     if (_err != noErr) return PyMac_Error(_err);
  4905.     _res = Py_BuildValue("O&",
  4906.                          ResObj_New, ctab);
  4907.     return _res;
  4908. }
  4909.  
  4910. static PyObject *MovieObj_FlattenMovie(_self, _args)
  4911.     MovieObject *_self;
  4912.     PyObject *_args;
  4913. {
  4914.     PyObject *_res = NULL;
  4915.     long movieFlattenFlags;
  4916.     FSSpec theFile;
  4917.     OSType creator;
  4918.     ScriptCode scriptTag;
  4919.     long createMovieFileFlags;
  4920.     short resId;
  4921.     Str255 resName;
  4922.     if (!PyArg_ParseTuple(_args, "lO&O&hlO&",
  4923.                           &movieFlattenFlags,
  4924.                           PyMac_GetFSSpec, &theFile,
  4925.                           PyMac_GetOSType, &creator,
  4926.                           &scriptTag,
  4927.                           &createMovieFileFlags,
  4928.                           PyMac_GetStr255, resName))
  4929.         return NULL;
  4930.     FlattenMovie(_self->ob_itself,
  4931.                  movieFlattenFlags,
  4932.                  &theFile,
  4933.                  creator,
  4934.                  scriptTag,
  4935.                  createMovieFileFlags,
  4936.                  &resId,
  4937.                  resName);
  4938.     _res = Py_BuildValue("h",
  4939.                          resId);
  4940.     return _res;
  4941. }
  4942.  
  4943. static PyObject *MovieObj_FlattenMovieData(_self, _args)
  4944.     MovieObject *_self;
  4945.     PyObject *_args;
  4946. {
  4947.     PyObject *_res = NULL;
  4948.     Movie _rv;
  4949.     long movieFlattenFlags;
  4950.     FSSpec theFile;
  4951.     OSType creator;
  4952.     ScriptCode scriptTag;
  4953.     long createMovieFileFlags;
  4954.     if (!PyArg_ParseTuple(_args, "lO&O&hl",
  4955.                           &movieFlattenFlags,
  4956.                           PyMac_GetFSSpec, &theFile,
  4957.                           PyMac_GetOSType, &creator,
  4958.                           &scriptTag,
  4959.                           &createMovieFileFlags))
  4960.         return NULL;
  4961.     _rv = FlattenMovieData(_self->ob_itself,
  4962.                            movieFlattenFlags,
  4963.                            &theFile,
  4964.                            creator,
  4965.                            scriptTag,
  4966.                            createMovieFileFlags);
  4967.     _res = Py_BuildValue("O&",
  4968.                          MovieObj_New, _rv);
  4969.     return _res;
  4970. }
  4971.  
  4972. static PyObject *MovieObj_MovieSearchText(_self, _args)
  4973.     MovieObject *_self;
  4974.     PyObject *_args;
  4975. {
  4976.     PyObject *_res = NULL;
  4977.     OSErr _err;
  4978.     Ptr text;
  4979.     long size;
  4980.     long searchFlags;
  4981.     Track searchTrack;
  4982.     TimeValue searchTime;
  4983.     long searchOffset;
  4984.     if (!PyArg_ParseTuple(_args, "sll",
  4985.                           &text,
  4986.                           &size,
  4987.                           &searchFlags))
  4988.         return NULL;
  4989.     _err = MovieSearchText(_self->ob_itself,
  4990.                            text,
  4991.                            size,
  4992.                            searchFlags,
  4993.                            &searchTrack,
  4994.                            &searchTime,
  4995.                            &searchOffset);
  4996.     if (_err != noErr) return PyMac_Error(_err);
  4997.     _res = Py_BuildValue("O&ll",
  4998.                          TrackObj_New, searchTrack,
  4999.                          searchTime,
  5000.                          searchOffset);
  5001.     return _res;
  5002. }
  5003.  
  5004. static PyObject *MovieObj_GetPosterBox(_self, _args)
  5005.     MovieObject *_self;
  5006.     PyObject *_args;
  5007. {
  5008.     PyObject *_res = NULL;
  5009.     Rect boxRect;
  5010.     if (!PyArg_ParseTuple(_args, ""))
  5011.         return NULL;
  5012.     GetPosterBox(_self->ob_itself,
  5013.                  &boxRect);
  5014.     _res = Py_BuildValue("O&",
  5015.                          PyMac_BuildRect, &boxRect);
  5016.     return _res;
  5017. }
  5018.  
  5019. static PyObject *MovieObj_SetPosterBox(_self, _args)
  5020.     MovieObject *_self;
  5021.     PyObject *_args;
  5022. {
  5023.     PyObject *_res = NULL;
  5024.     Rect boxRect;
  5025.     if (!PyArg_ParseTuple(_args, "O&",
  5026.                           PyMac_GetRect, &boxRect))
  5027.         return NULL;
  5028.     SetPosterBox(_self->ob_itself,
  5029.                  &boxRect);
  5030.     Py_INCREF(Py_None);
  5031.     _res = Py_None;
  5032.     return _res;
  5033. }
  5034.  
  5035. static PyObject *MovieObj_GetMovieSegmentDisplayBoundsRgn(_self, _args)
  5036.     MovieObject *_self;
  5037.     PyObject *_args;
  5038. {
  5039.     PyObject *_res = NULL;
  5040.     RgnHandle _rv;
  5041.     TimeValue time;
  5042.     TimeValue duration;
  5043.     if (!PyArg_ParseTuple(_args, "ll",
  5044.                           &time,
  5045.                           &duration))
  5046.         return NULL;
  5047.     _rv = GetMovieSegmentDisplayBoundsRgn(_self->ob_itself,
  5048.                                           time,
  5049.                                           duration);
  5050.     _res = Py_BuildValue("O&",
  5051.                          ResObj_New, _rv);
  5052.     return _res;
  5053. }
  5054.  
  5055. static PyObject *MovieObj_GetMovieStatus(_self, _args)
  5056.     MovieObject *_self;
  5057.     PyObject *_args;
  5058. {
  5059.     PyObject *_res = NULL;
  5060.     ComponentResult _rv;
  5061.     Track firstProblemTrack;
  5062.     if (!PyArg_ParseTuple(_args, ""))
  5063.         return NULL;
  5064.     _rv = GetMovieStatus(_self->ob_itself,
  5065.                          &firstProblemTrack);
  5066.     _res = Py_BuildValue("lO&",
  5067.                          _rv,
  5068.                          TrackObj_New, firstProblemTrack);
  5069.     return _res;
  5070. }
  5071.  
  5072. static PyObject *MovieObj_NewMovieController(_self, _args)
  5073.     MovieObject *_self;
  5074.     PyObject *_args;
  5075. {
  5076.     PyObject *_res = NULL;
  5077.     MovieController _rv;
  5078.     Rect movieRect;
  5079.     long someFlags;
  5080.     if (!PyArg_ParseTuple(_args, "O&l",
  5081.                           PyMac_GetRect, &movieRect,
  5082.                           &someFlags))
  5083.         return NULL;
  5084.     _rv = NewMovieController(_self->ob_itself,
  5085.                              &movieRect,
  5086.                              someFlags);
  5087.     _res = Py_BuildValue("O&",
  5088.                          MovieCtlObj_New, _rv);
  5089.     return _res;
  5090. }
  5091.  
  5092. static PyObject *MovieObj_PutMovieOnScrap(_self, _args)
  5093.     MovieObject *_self;
  5094.     PyObject *_args;
  5095. {
  5096.     PyObject *_res = NULL;
  5097.     OSErr _err;
  5098.     long movieScrapFlags;
  5099.     if (!PyArg_ParseTuple(_args, "l",
  5100.                           &movieScrapFlags))
  5101.         return NULL;
  5102.     _err = PutMovieOnScrap(_self->ob_itself,
  5103.                            movieScrapFlags);
  5104.     if (_err != noErr) return PyMac_Error(_err);
  5105.     Py_INCREF(Py_None);
  5106.     _res = Py_None;
  5107.     return _res;
  5108. }
  5109.  
  5110. static PyObject *MovieObj_SetMoviePlayHints(_self, _args)
  5111.     MovieObject *_self;
  5112.     PyObject *_args;
  5113. {
  5114.     PyObject *_res = NULL;
  5115.     long flags;
  5116.     long flagsMask;
  5117.     if (!PyArg_ParseTuple(_args, "ll",
  5118.                           &flags,
  5119.                           &flagsMask))
  5120.         return NULL;
  5121.     SetMoviePlayHints(_self->ob_itself,
  5122.                       flags,
  5123.                       flagsMask);
  5124.     Py_INCREF(Py_None);
  5125.     _res = Py_None;
  5126.     return _res;
  5127. }
  5128.  
  5129. static PyMethodDef MovieObj_methods[] = {
  5130.     {"MoviesTask", (PyCFunction)MovieObj_MoviesTask, 1,
  5131.      "(long maxMilliSecToUse) -> None"},
  5132.     {"PrerollMovie", (PyCFunction)MovieObj_PrerollMovie, 1,
  5133.      "(TimeValue time, Fixed Rate) -> None"},
  5134.     {"LoadMovieIntoRam", (PyCFunction)MovieObj_LoadMovieIntoRam, 1,
  5135.      "(TimeValue time, TimeValue duration, long flags) -> None"},
  5136.     {"SetMovieActive", (PyCFunction)MovieObj_SetMovieActive, 1,
  5137.      "(Boolean active) -> None"},
  5138.     {"GetMovieActive", (PyCFunction)MovieObj_GetMovieActive, 1,
  5139.      "() -> (Boolean _rv)"},
  5140.     {"StartMovie", (PyCFunction)MovieObj_StartMovie, 1,
  5141.      "() -> None"},
  5142.     {"StopMovie", (PyCFunction)MovieObj_StopMovie, 1,
  5143.      "() -> None"},
  5144.     {"GoToBeginningOfMovie", (PyCFunction)MovieObj_GoToBeginningOfMovie, 1,
  5145.      "() -> None"},
  5146.     {"GoToEndOfMovie", (PyCFunction)MovieObj_GoToEndOfMovie, 1,
  5147.      "() -> None"},
  5148.     {"IsMovieDone", (PyCFunction)MovieObj_IsMovieDone, 1,
  5149.      "() -> (Boolean _rv)"},
  5150.     {"GetMoviePreviewMode", (PyCFunction)MovieObj_GetMoviePreviewMode, 1,
  5151.      "() -> (Boolean _rv)"},
  5152.     {"SetMoviePreviewMode", (PyCFunction)MovieObj_SetMoviePreviewMode, 1,
  5153.      "(Boolean usePreview) -> None"},
  5154.     {"ShowMoviePoster", (PyCFunction)MovieObj_ShowMoviePoster, 1,
  5155.      "() -> None"},
  5156.     {"GetMovieTimeBase", (PyCFunction)MovieObj_GetMovieTimeBase, 1,
  5157.      "() -> (TimeBase _rv)"},
  5158.     {"GetNextTrackForCompositing", (PyCFunction)MovieObj_GetNextTrackForCompositing, 1,
  5159.      "(Track theTrack) -> (Track _rv)"},
  5160.     {"GetPrevTrackForCompositing", (PyCFunction)MovieObj_GetPrevTrackForCompositing, 1,
  5161.      "(Track theTrack) -> (Track _rv)"},
  5162.     {"GetMoviePict", (PyCFunction)MovieObj_GetMoviePict, 1,
  5163.      "(TimeValue time) -> (PicHandle _rv)"},
  5164.     {"GetMoviePosterPict", (PyCFunction)MovieObj_GetMoviePosterPict, 1,
  5165.      "() -> (PicHandle _rv)"},
  5166.     {"UpdateMovie", (PyCFunction)MovieObj_UpdateMovie, 1,
  5167.      "() -> None"},
  5168.     {"GetMovieBox", (PyCFunction)MovieObj_GetMovieBox, 1,
  5169.      "() -> (Rect boxRect)"},
  5170.     {"SetMovieBox", (PyCFunction)MovieObj_SetMovieBox, 1,
  5171.      "(Rect boxRect) -> None"},
  5172.     {"GetMovieDisplayClipRgn", (PyCFunction)MovieObj_GetMovieDisplayClipRgn, 1,
  5173.      "() -> (RgnHandle _rv)"},
  5174.     {"SetMovieDisplayClipRgn", (PyCFunction)MovieObj_SetMovieDisplayClipRgn, 1,
  5175.      "(RgnHandle theClip) -> None"},
  5176.     {"GetMovieClipRgn", (PyCFunction)MovieObj_GetMovieClipRgn, 1,
  5177.      "() -> (RgnHandle _rv)"},
  5178.     {"SetMovieClipRgn", (PyCFunction)MovieObj_SetMovieClipRgn, 1,
  5179.      "(RgnHandle theClip) -> None"},
  5180.     {"GetMovieDisplayBoundsRgn", (PyCFunction)MovieObj_GetMovieDisplayBoundsRgn, 1,
  5181.      "() -> (RgnHandle _rv)"},
  5182.     {"GetMovieBoundsRgn", (PyCFunction)MovieObj_GetMovieBoundsRgn, 1,
  5183.      "() -> (RgnHandle _rv)"},
  5184.     {"PutMovieIntoHandle", (PyCFunction)MovieObj_PutMovieIntoHandle, 1,
  5185.      "(Handle publicMovie) -> None"},
  5186.     {"PutMovieIntoDataFork", (PyCFunction)MovieObj_PutMovieIntoDataFork, 1,
  5187.      "(short fRefNum, long offset, long maxSize) -> None"},
  5188.     {"GetMovieTimeScale", (PyCFunction)MovieObj_GetMovieTimeScale, 1,
  5189.      "() -> (TimeScale _rv)"},
  5190.     {"SetMovieTimeScale", (PyCFunction)MovieObj_SetMovieTimeScale, 1,
  5191.      "(TimeScale timeScale) -> None"},
  5192.     {"GetMovieDuration", (PyCFunction)MovieObj_GetMovieDuration, 1,
  5193.      "() -> (TimeValue _rv)"},
  5194.     {"GetMovieRate", (PyCFunction)MovieObj_GetMovieRate, 1,
  5195.      "() -> (Fixed _rv)"},
  5196.     {"SetMovieRate", (PyCFunction)MovieObj_SetMovieRate, 1,
  5197.      "(Fixed rate) -> None"},
  5198.     {"GetMoviePreferredRate", (PyCFunction)MovieObj_GetMoviePreferredRate, 1,
  5199.      "() -> (Fixed _rv)"},
  5200.     {"SetMoviePreferredRate", (PyCFunction)MovieObj_SetMoviePreferredRate, 1,
  5201.      "(Fixed rate) -> None"},
  5202.     {"GetMoviePreferredVolume", (PyCFunction)MovieObj_GetMoviePreferredVolume, 1,
  5203.      "() -> (short _rv)"},
  5204.     {"SetMoviePreferredVolume", (PyCFunction)MovieObj_SetMoviePreferredVolume, 1,
  5205.      "(short volume) -> None"},
  5206.     {"GetMovieVolume", (PyCFunction)MovieObj_GetMovieVolume, 1,
  5207.      "() -> (short _rv)"},
  5208.     {"SetMovieVolume", (PyCFunction)MovieObj_SetMovieVolume, 1,
  5209.      "(short volume) -> None"},
  5210.     {"GetMoviePreviewTime", (PyCFunction)MovieObj_GetMoviePreviewTime, 1,
  5211.      "() -> (TimeValue previewTime, TimeValue previewDuration)"},
  5212.     {"SetMoviePreviewTime", (PyCFunction)MovieObj_SetMoviePreviewTime, 1,
  5213.      "(TimeValue previewTime, TimeValue previewDuration) -> None"},
  5214.     {"GetMoviePosterTime", (PyCFunction)MovieObj_GetMoviePosterTime, 1,
  5215.      "() -> (TimeValue _rv)"},
  5216.     {"SetMoviePosterTime", (PyCFunction)MovieObj_SetMoviePosterTime, 1,
  5217.      "(TimeValue posterTime) -> None"},
  5218.     {"GetMovieSelection", (PyCFunction)MovieObj_GetMovieSelection, 1,
  5219.      "() -> (TimeValue selectionTime, TimeValue selectionDuration)"},
  5220.     {"SetMovieSelection", (PyCFunction)MovieObj_SetMovieSelection, 1,
  5221.      "(TimeValue selectionTime, TimeValue selectionDuration) -> None"},
  5222.     {"SetMovieActiveSegment", (PyCFunction)MovieObj_SetMovieActiveSegment, 1,
  5223.      "(TimeValue startTime, TimeValue duration) -> None"},
  5224.     {"GetMovieActiveSegment", (PyCFunction)MovieObj_GetMovieActiveSegment, 1,
  5225.      "() -> (TimeValue startTime, TimeValue duration)"},
  5226.     {"SetMovieTimeValue", (PyCFunction)MovieObj_SetMovieTimeValue, 1,
  5227.      "(TimeValue newtime) -> None"},
  5228.     {"GetMovieUserData", (PyCFunction)MovieObj_GetMovieUserData, 1,
  5229.      "() -> (UserData _rv)"},
  5230.     {"GetMovieTrackCount", (PyCFunction)MovieObj_GetMovieTrackCount, 1,
  5231.      "() -> (long _rv)"},
  5232.     {"GetMovieTrack", (PyCFunction)MovieObj_GetMovieTrack, 1,
  5233.      "(long trackID) -> (Track _rv)"},
  5234.     {"GetMovieIndTrack", (PyCFunction)MovieObj_GetMovieIndTrack, 1,
  5235.      "(long index) -> (Track _rv)"},
  5236.     {"GetMovieIndTrackType", (PyCFunction)MovieObj_GetMovieIndTrackType, 1,
  5237.      "(long index, OSType trackType, long flags) -> (Track _rv)"},
  5238.     {"NewMovieTrack", (PyCFunction)MovieObj_NewMovieTrack, 1,
  5239.      "(Fixed width, Fixed height, short trackVolume) -> (Track _rv)"},
  5240.     {"SetAutoTrackAlternatesEnabled", (PyCFunction)MovieObj_SetAutoTrackAlternatesEnabled, 1,
  5241.      "(Boolean enable) -> None"},
  5242.     {"SelectMovieAlternates", (PyCFunction)MovieObj_SelectMovieAlternates, 1,
  5243.      "() -> None"},
  5244.     {"InsertMovieSegment", (PyCFunction)MovieObj_InsertMovieSegment, 1,
  5245.      "(Movie dstMovie, TimeValue srcIn, TimeValue srcDuration, TimeValue dstIn) -> None"},
  5246.     {"InsertEmptyMovieSegment", (PyCFunction)MovieObj_InsertEmptyMovieSegment, 1,
  5247.      "(TimeValue dstIn, TimeValue dstDuration) -> None"},
  5248.     {"DeleteMovieSegment", (PyCFunction)MovieObj_DeleteMovieSegment, 1,
  5249.      "(TimeValue startTime, TimeValue duration) -> None"},
  5250.     {"ScaleMovieSegment", (PyCFunction)MovieObj_ScaleMovieSegment, 1,
  5251.      "(TimeValue startTime, TimeValue oldDuration, TimeValue newDuration) -> None"},
  5252.     {"CutMovieSelection", (PyCFunction)MovieObj_CutMovieSelection, 1,
  5253.      "() -> (Movie _rv)"},
  5254.     {"CopyMovieSelection", (PyCFunction)MovieObj_CopyMovieSelection, 1,
  5255.      "() -> (Movie _rv)"},
  5256.     {"PasteMovieSelection", (PyCFunction)MovieObj_PasteMovieSelection, 1,
  5257.      "(Movie src) -> None"},
  5258.     {"AddMovieSelection", (PyCFunction)MovieObj_AddMovieSelection, 1,
  5259.      "(Movie src) -> None"},
  5260.     {"ClearMovieSelection", (PyCFunction)MovieObj_ClearMovieSelection, 1,
  5261.      "() -> None"},
  5262.     {"PutMovieIntoTypedHandle", (PyCFunction)MovieObj_PutMovieIntoTypedHandle, 1,
  5263.      "(Track targetTrack, OSType handleType, Handle publicMovie, TimeValue start, TimeValue dur, long flags, ComponentInstance userComp) -> None"},
  5264.     {"CopyMovieSettings", (PyCFunction)MovieObj_CopyMovieSettings, 1,
  5265.      "(Movie dstMovie) -> None"},
  5266.     {"ConvertMovieToFile", (PyCFunction)MovieObj_ConvertMovieToFile, 1,
  5267.      "(Track onlyTrack, FSSpec outputFile, OSType fileType, OSType creator, ScriptCode scriptTag, long flags, ComponentInstance userComp) -> (short resID)"},
  5268.     {"GetMovieDataSize", (PyCFunction)MovieObj_GetMovieDataSize, 1,
  5269.      "(TimeValue startTime, TimeValue duration) -> (long _rv)"},
  5270.     {"PtInMovie", (PyCFunction)MovieObj_PtInMovie, 1,
  5271.      "(Point pt) -> (Boolean _rv)"},
  5272.     {"SetMovieLanguage", (PyCFunction)MovieObj_SetMovieLanguage, 1,
  5273.      "(long language) -> None"},
  5274.     {"GetMovieNextInterestingTime", (PyCFunction)MovieObj_GetMovieNextInterestingTime, 1,
  5275.      "(short interestingTimeFlags, short numMediaTypes, OSType whichMediaTypes, TimeValue time, Fixed rate) -> (TimeValue interestingTime, TimeValue interestingDuration)"},
  5276.     {"AddMovieResource", (PyCFunction)MovieObj_AddMovieResource, 1,
  5277.      "(short resRefNum, Str255 resName) -> (short resId)"},
  5278.     {"UpdateMovieResource", (PyCFunction)MovieObj_UpdateMovieResource, 1,
  5279.      "(short resRefNum, short resId, Str255 resName) -> None"},
  5280.     {"HasMovieChanged", (PyCFunction)MovieObj_HasMovieChanged, 1,
  5281.      "() -> (Boolean _rv)"},
  5282.     {"ClearMovieChanged", (PyCFunction)MovieObj_ClearMovieChanged, 1,
  5283.      "() -> None"},
  5284.     {"SetMovieDefaultDataRef", (PyCFunction)MovieObj_SetMovieDefaultDataRef, 1,
  5285.      "(Handle dataRef, OSType dataRefType) -> None"},
  5286.     {"GetMovieDefaultDataRef", (PyCFunction)MovieObj_GetMovieDefaultDataRef, 1,
  5287.      "() -> (Handle dataRef, OSType dataRefType)"},
  5288.     {"SetMovieColorTable", (PyCFunction)MovieObj_SetMovieColorTable, 1,
  5289.      "(CTabHandle ctab) -> None"},
  5290.     {"GetMovieColorTable", (PyCFunction)MovieObj_GetMovieColorTable, 1,
  5291.      "() -> (CTabHandle ctab)"},
  5292.     {"FlattenMovie", (PyCFunction)MovieObj_FlattenMovie, 1,
  5293.      "(long movieFlattenFlags, FSSpec theFile, OSType creator, ScriptCode scriptTag, long createMovieFileFlags, Str255 resName) -> (short resId)"},
  5294.     {"FlattenMovieData", (PyCFunction)MovieObj_FlattenMovieData, 1,
  5295.      "(long movieFlattenFlags, FSSpec theFile, OSType creator, ScriptCode scriptTag, long createMovieFileFlags) -> (Movie _rv)"},
  5296.     {"MovieSearchText", (PyCFunction)MovieObj_MovieSearchText, 1,
  5297.      "(Ptr text, long size, long searchFlags) -> (Track searchTrack, TimeValue searchTime, long searchOffset)"},
  5298.     {"GetPosterBox", (PyCFunction)MovieObj_GetPosterBox, 1,
  5299.      "() -> (Rect boxRect)"},
  5300.     {"SetPosterBox", (PyCFunction)MovieObj_SetPosterBox, 1,
  5301.      "(Rect boxRect) -> None"},
  5302.     {"GetMovieSegmentDisplayBoundsRgn", (PyCFunction)MovieObj_GetMovieSegmentDisplayBoundsRgn, 1,
  5303.      "(TimeValue time, TimeValue duration) -> (RgnHandle _rv)"},
  5304.     {"GetMovieStatus", (PyCFunction)MovieObj_GetMovieStatus, 1,
  5305.      "() -> (ComponentResult _rv, Track firstProblemTrack)"},
  5306.     {"NewMovieController", (PyCFunction)MovieObj_NewMovieController, 1,
  5307.      "(Rect movieRect, long someFlags) -> (MovieController _rv)"},
  5308.     {"PutMovieOnScrap", (PyCFunction)MovieObj_PutMovieOnScrap, 1,
  5309.      "(long movieScrapFlags) -> None"},
  5310.     {"SetMoviePlayHints", (PyCFunction)MovieObj_SetMoviePlayHints, 1,
  5311.      "(long flags, long flagsMask) -> None"},
  5312.     {NULL, NULL, 0}
  5313. };
  5314.  
  5315. PyMethodChain MovieObj_chain = { MovieObj_methods, NULL };
  5316.  
  5317. static PyObject *MovieObj_getattr(self, name)
  5318.     MovieObject *self;
  5319.     char *name;
  5320. {
  5321.     return Py_FindMethodInChain(&MovieObj_chain, (PyObject *)self, name);
  5322. }
  5323.  
  5324. #define MovieObj_setattr NULL
  5325.  
  5326. PyTypeObject Movie_Type = {
  5327.     PyObject_HEAD_INIT(&PyType_Type)
  5328.     0, /*ob_size*/
  5329.     "Movie", /*tp_name*/
  5330.     sizeof(MovieObject), /*tp_basicsize*/
  5331.     0, /*tp_itemsize*/
  5332.     /* methods */
  5333.     (destructor) MovieObj_dealloc, /*tp_dealloc*/
  5334.     0, /*tp_print*/
  5335.     (getattrfunc) MovieObj_getattr, /*tp_getattr*/
  5336.     (setattrfunc) MovieObj_setattr, /*tp_setattr*/
  5337. };
  5338.  
  5339. /* --------------------- End object type Movie ---------------------- */
  5340.  
  5341.  
  5342. static PyObject *Qt_EnterMovies(_self, _args)
  5343.     PyObject *_self;
  5344.     PyObject *_args;
  5345. {
  5346.     PyObject *_res = NULL;
  5347.     OSErr _err;
  5348.     if (!PyArg_ParseTuple(_args, ""))
  5349.         return NULL;
  5350.     _err = EnterMovies();
  5351.     if (_err != noErr) return PyMac_Error(_err);
  5352.     Py_INCREF(Py_None);
  5353.     _res = Py_None;
  5354.     return _res;
  5355. }
  5356.  
  5357. static PyObject *Qt_ExitMovies(_self, _args)
  5358.     PyObject *_self;
  5359.     PyObject *_args;
  5360. {
  5361.     PyObject *_res = NULL;
  5362.     if (!PyArg_ParseTuple(_args, ""))
  5363.         return NULL;
  5364.     ExitMovies();
  5365.     Py_INCREF(Py_None);
  5366.     _res = Py_None;
  5367.     return _res;
  5368. }
  5369.  
  5370. static PyObject *Qt_GetMoviesError(_self, _args)
  5371.     PyObject *_self;
  5372.     PyObject *_args;
  5373. {
  5374.     PyObject *_res = NULL;
  5375.     OSErr _err;
  5376.     if (!PyArg_ParseTuple(_args, ""))
  5377.         return NULL;
  5378.     _err = GetMoviesError();
  5379.     if (_err != noErr) return PyMac_Error(_err);
  5380.     Py_INCREF(Py_None);
  5381.     _res = Py_None;
  5382.     return _res;
  5383. }
  5384.  
  5385. static PyObject *Qt_ClearMoviesStickyError(_self, _args)
  5386.     PyObject *_self;
  5387.     PyObject *_args;
  5388. {
  5389.     PyObject *_res = NULL;
  5390.     if (!PyArg_ParseTuple(_args, ""))
  5391.         return NULL;
  5392.     ClearMoviesStickyError();
  5393.     Py_INCREF(Py_None);
  5394.     _res = Py_None;
  5395.     return _res;
  5396. }
  5397.  
  5398. static PyObject *Qt_GetMoviesStickyError(_self, _args)
  5399.     PyObject *_self;
  5400.     PyObject *_args;
  5401. {
  5402.     PyObject *_res = NULL;
  5403.     OSErr _err;
  5404.     if (!PyArg_ParseTuple(_args, ""))
  5405.         return NULL;
  5406.     _err = GetMoviesStickyError();
  5407.     if (_err != noErr) return PyMac_Error(_err);
  5408.     Py_INCREF(Py_None);
  5409.     _res = Py_None;
  5410.     return _res;
  5411. }
  5412.  
  5413. static PyObject *Qt_DisposeMatte(_self, _args)
  5414.     PyObject *_self;
  5415.     PyObject *_args;
  5416. {
  5417.     PyObject *_res = NULL;
  5418.     PixMapHandle theMatte;
  5419.     if (!PyArg_ParseTuple(_args, "O&",
  5420.                           ResObj_Convert, &theMatte))
  5421.         return NULL;
  5422.     DisposeMatte(theMatte);
  5423.     Py_INCREF(Py_None);
  5424.     _res = Py_None;
  5425.     return _res;
  5426. }
  5427.  
  5428. static PyObject *Qt_NewMovie(_self, _args)
  5429.     PyObject *_self;
  5430.     PyObject *_args;
  5431. {
  5432.     PyObject *_res = NULL;
  5433.     Movie _rv;
  5434.     long flags;
  5435.     if (!PyArg_ParseTuple(_args, "l",
  5436.                           &flags))
  5437.         return NULL;
  5438.     _rv = NewMovie(flags);
  5439.     _res = Py_BuildValue("O&",
  5440.                          MovieObj_New, _rv);
  5441.     return _res;
  5442. }
  5443.  
  5444. static PyObject *Qt_GetDataHandler(_self, _args)
  5445.     PyObject *_self;
  5446.     PyObject *_args;
  5447. {
  5448.     PyObject *_res = NULL;
  5449.     Component _rv;
  5450.     Handle dataRef;
  5451.     OSType dataHandlerSubType;
  5452.     long flags;
  5453.     if (!PyArg_ParseTuple(_args, "O&O&l",
  5454.                           ResObj_Convert, &dataRef,
  5455.                           PyMac_GetOSType, &dataHandlerSubType,
  5456.                           &flags))
  5457.         return NULL;
  5458.     _rv = GetDataHandler(dataRef,
  5459.                          dataHandlerSubType,
  5460.                          flags);
  5461.     _res = Py_BuildValue("O&",
  5462.                          CmpObj_New, _rv);
  5463.     return _res;
  5464. }
  5465.  
  5466. static PyObject *Qt_PasteHandleIntoMovie(_self, _args)
  5467.     PyObject *_self;
  5468.     PyObject *_args;
  5469. {
  5470.     PyObject *_res = NULL;
  5471.     OSErr _err;
  5472.     Handle h;
  5473.     OSType handleType;
  5474.     Movie theMovie;
  5475.     long flags;
  5476.     ComponentInstance userComp;
  5477.     if (!PyArg_ParseTuple(_args, "O&O&O&lO&",
  5478.                           ResObj_Convert, &h,
  5479.                           PyMac_GetOSType, &handleType,
  5480.                           MovieObj_Convert, &theMovie,
  5481.                           &flags,
  5482.                           CmpInstObj_Convert, &userComp))
  5483.         return NULL;
  5484.     _err = PasteHandleIntoMovie(h,
  5485.                                 handleType,
  5486.                                 theMovie,
  5487.                                 flags,
  5488.                                 userComp);
  5489.     if (_err != noErr) return PyMac_Error(_err);
  5490.     Py_INCREF(Py_None);
  5491.     _res = Py_None;
  5492.     return _res;
  5493. }
  5494.  
  5495. static PyObject *Qt_TrackTimeToMediaTime(_self, _args)
  5496.     PyObject *_self;
  5497.     PyObject *_args;
  5498. {
  5499.     PyObject *_res = NULL;
  5500.     TimeValue _rv;
  5501.     TimeValue value;
  5502.     Track theTrack;
  5503.     if (!PyArg_ParseTuple(_args, "lO&",
  5504.                           &value,
  5505.                           TrackObj_Convert, &theTrack))
  5506.         return NULL;
  5507.     _rv = TrackTimeToMediaTime(value,
  5508.                                theTrack);
  5509.     _res = Py_BuildValue("l",
  5510.                          _rv);
  5511.     return _res;
  5512. }
  5513.  
  5514. static PyObject *Qt_NewUserData(_self, _args)
  5515.     PyObject *_self;
  5516.     PyObject *_args;
  5517. {
  5518.     PyObject *_res = NULL;
  5519.     OSErr _err;
  5520.     UserData theUserData;
  5521.     if (!PyArg_ParseTuple(_args, ""))
  5522.         return NULL;
  5523.     _err = NewUserData(&theUserData);
  5524.     if (_err != noErr) return PyMac_Error(_err);
  5525.     _res = Py_BuildValue("O&",
  5526.                          UserDataObj_New, theUserData);
  5527.     return _res;
  5528. }
  5529.  
  5530. static PyObject *Qt_NewUserDataFromHandle(_self, _args)
  5531.     PyObject *_self;
  5532.     PyObject *_args;
  5533. {
  5534.     PyObject *_res = NULL;
  5535.     OSErr _err;
  5536.     Handle h;
  5537.     UserData theUserData;
  5538.     if (!PyArg_ParseTuple(_args, "O&",
  5539.                           ResObj_Convert, &h))
  5540.         return NULL;
  5541.     _err = NewUserDataFromHandle(h,
  5542.                                  &theUserData);
  5543.     if (_err != noErr) return PyMac_Error(_err);
  5544.     _res = Py_BuildValue("O&",
  5545.                          UserDataObj_New, theUserData);
  5546.     return _res;
  5547. }
  5548.  
  5549. static PyObject *Qt_CreateMovieFile(_self, _args)
  5550.     PyObject *_self;
  5551.     PyObject *_args;
  5552. {
  5553.     PyObject *_res = NULL;
  5554.     OSErr _err;
  5555.     FSSpec fileSpec;
  5556.     OSType creator;
  5557.     ScriptCode scriptTag;
  5558.     long createMovieFileFlags;
  5559.     short resRefNum;
  5560.     Movie newmovie;
  5561.     if (!PyArg_ParseTuple(_args, "O&O&hl",
  5562.                           PyMac_GetFSSpec, &fileSpec,
  5563.                           PyMac_GetOSType, &creator,
  5564.                           &scriptTag,
  5565.                           &createMovieFileFlags))
  5566.         return NULL;
  5567.     _err = CreateMovieFile(&fileSpec,
  5568.                            creator,
  5569.                            scriptTag,
  5570.                            createMovieFileFlags,
  5571.                            &resRefNum,
  5572.                            &newmovie);
  5573.     if (_err != noErr) return PyMac_Error(_err);
  5574.     _res = Py_BuildValue("hO&",
  5575.                          resRefNum,
  5576.                          MovieObj_New, newmovie);
  5577.     return _res;
  5578. }
  5579.  
  5580. static PyObject *Qt_OpenMovieFile(_self, _args)
  5581.     PyObject *_self;
  5582.     PyObject *_args;
  5583. {
  5584.     PyObject *_res = NULL;
  5585.     OSErr _err;
  5586.     FSSpec fileSpec;
  5587.     short resRefNum;
  5588.     SInt8 permission;
  5589.     if (!PyArg_ParseTuple(_args, "O&b",
  5590.                           PyMac_GetFSSpec, &fileSpec,
  5591.                           &permission))
  5592.         return NULL;
  5593.     _err = OpenMovieFile(&fileSpec,
  5594.                          &resRefNum,
  5595.                          permission);
  5596.     if (_err != noErr) return PyMac_Error(_err);
  5597.     _res = Py_BuildValue("h",
  5598.                          resRefNum);
  5599.     return _res;
  5600. }
  5601.  
  5602. static PyObject *Qt_CloseMovieFile(_self, _args)
  5603.     PyObject *_self;
  5604.     PyObject *_args;
  5605. {
  5606.     PyObject *_res = NULL;
  5607.     OSErr _err;
  5608.     short resRefNum;
  5609.     if (!PyArg_ParseTuple(_args, "h",
  5610.                           &resRefNum))
  5611.         return NULL;
  5612.     _err = CloseMovieFile(resRefNum);
  5613.     if (_err != noErr) return PyMac_Error(_err);
  5614.     Py_INCREF(Py_None);
  5615.     _res = Py_None;
  5616.     return _res;
  5617. }
  5618.  
  5619. static PyObject *Qt_DeleteMovieFile(_self, _args)
  5620.     PyObject *_self;
  5621.     PyObject *_args;
  5622. {
  5623.     PyObject *_res = NULL;
  5624.     OSErr _err;
  5625.     FSSpec fileSpec;
  5626.     if (!PyArg_ParseTuple(_args, "O&",
  5627.                           PyMac_GetFSSpec, &fileSpec))
  5628.         return NULL;
  5629.     _err = DeleteMovieFile(&fileSpec);
  5630.     if (_err != noErr) return PyMac_Error(_err);
  5631.     Py_INCREF(Py_None);
  5632.     _res = Py_None;
  5633.     return _res;
  5634. }
  5635.  
  5636. static PyObject *Qt_NewMovieFromFile(_self, _args)
  5637.     PyObject *_self;
  5638.     PyObject *_args;
  5639. {
  5640.     PyObject *_res = NULL;
  5641.     OSErr _err;
  5642.     Movie theMovie;
  5643.     short resRefNum;
  5644.     short newMovieFlags;
  5645.     Boolean dataRefWasChanged;
  5646.     if (!PyArg_ParseTuple(_args, "hh",
  5647.                           &resRefNum,
  5648.                           &newMovieFlags))
  5649.         return NULL;
  5650.     _err = NewMovieFromFile(&theMovie,
  5651.                             resRefNum,
  5652.                             (short *)0,
  5653.                             (StringPtr)0,
  5654.                             newMovieFlags,
  5655.                             &dataRefWasChanged);
  5656.     if (_err != noErr) return PyMac_Error(_err);
  5657.     _res = Py_BuildValue("O&b",
  5658.                          MovieObj_New, theMovie,
  5659.                          dataRefWasChanged);
  5660.     return _res;
  5661. }
  5662.  
  5663. static PyObject *Qt_NewMovieFromHandle(_self, _args)
  5664.     PyObject *_self;
  5665.     PyObject *_args;
  5666. {
  5667.     PyObject *_res = NULL;
  5668.     OSErr _err;
  5669.     Movie theMovie;
  5670.     Handle h;
  5671.     short newMovieFlags;
  5672.     Boolean dataRefWasChanged;
  5673.     if (!PyArg_ParseTuple(_args, "O&h",
  5674.                           ResObj_Convert, &h,
  5675.                           &newMovieFlags))
  5676.         return NULL;
  5677.     _err = NewMovieFromHandle(&theMovie,
  5678.                               h,
  5679.                               newMovieFlags,
  5680.                               &dataRefWasChanged);
  5681.     if (_err != noErr) return PyMac_Error(_err);
  5682.     _res = Py_BuildValue("O&b",
  5683.                          MovieObj_New, theMovie,
  5684.                          dataRefWasChanged);
  5685.     return _res;
  5686. }
  5687.  
  5688. static PyObject *Qt_NewMovieFromDataFork(_self, _args)
  5689.     PyObject *_self;
  5690.     PyObject *_args;
  5691. {
  5692.     PyObject *_res = NULL;
  5693.     OSErr _err;
  5694.     Movie theMovie;
  5695.     short fRefNum;
  5696.     long fileOffset;
  5697.     short newMovieFlags;
  5698.     Boolean dataRefWasChanged;
  5699.     if (!PyArg_ParseTuple(_args, "hlh",
  5700.                           &fRefNum,
  5701.                           &fileOffset,
  5702.                           &newMovieFlags))
  5703.         return NULL;
  5704.     _err = NewMovieFromDataFork(&theMovie,
  5705.                                 fRefNum,
  5706.                                 fileOffset,
  5707.                                 newMovieFlags,
  5708.                                 &dataRefWasChanged);
  5709.     if (_err != noErr) return PyMac_Error(_err);
  5710.     _res = Py_BuildValue("O&b",
  5711.                          MovieObj_New, theMovie,
  5712.                          dataRefWasChanged);
  5713.     return _res;
  5714. }
  5715.  
  5716. static PyObject *Qt_RemoveMovieResource(_self, _args)
  5717.     PyObject *_self;
  5718.     PyObject *_args;
  5719. {
  5720.     PyObject *_res = NULL;
  5721.     OSErr _err;
  5722.     short resRefNum;
  5723.     short resId;
  5724.     if (!PyArg_ParseTuple(_args, "hh",
  5725.                           &resRefNum,
  5726.                           &resId))
  5727.         return NULL;
  5728.     _err = RemoveMovieResource(resRefNum,
  5729.                                resId);
  5730.     if (_err != noErr) return PyMac_Error(_err);
  5731.     Py_INCREF(Py_None);
  5732.     _res = Py_None;
  5733.     return _res;
  5734. }
  5735.  
  5736. static PyObject *Qt_GetVideoMediaGraphicsMode(_self, _args)
  5737.     PyObject *_self;
  5738.     PyObject *_args;
  5739. {
  5740.     PyObject *_res = NULL;
  5741.     HandlerError _rv;
  5742.     MediaHandler mh;
  5743.     long graphicsMode;
  5744.     RGBColor opColor;
  5745.     if (!PyArg_ParseTuple(_args, "O&",
  5746.                           CmpInstObj_Convert, &mh))
  5747.         return NULL;
  5748.     _rv = GetVideoMediaGraphicsMode(mh,
  5749.                                     &graphicsMode,
  5750.                                     &opColor);
  5751.     _res = Py_BuildValue("llO&",
  5752.                          _rv,
  5753.                          graphicsMode,
  5754.                          QdRGB_New, &opColor);
  5755.     return _res;
  5756. }
  5757.  
  5758. static PyObject *Qt_SetVideoMediaGraphicsMode(_self, _args)
  5759.     PyObject *_self;
  5760.     PyObject *_args;
  5761. {
  5762.     PyObject *_res = NULL;
  5763.     HandlerError _rv;
  5764.     MediaHandler mh;
  5765.     long graphicsMode;
  5766.     RGBColor opColor;
  5767.     if (!PyArg_ParseTuple(_args, "O&lO&",
  5768.                           CmpInstObj_Convert, &mh,
  5769.                           &graphicsMode,
  5770.                           QdRGB_Convert, &opColor))
  5771.         return NULL;
  5772.     _rv = SetVideoMediaGraphicsMode(mh,
  5773.                                     graphicsMode,
  5774.                                     &opColor);
  5775.     _res = Py_BuildValue("l",
  5776.                          _rv);
  5777.     return _res;
  5778. }
  5779.  
  5780. static PyObject *Qt_GetSoundMediaBalance(_self, _args)
  5781.     PyObject *_self;
  5782.     PyObject *_args;
  5783. {
  5784.     PyObject *_res = NULL;
  5785.     HandlerError _rv;
  5786.     MediaHandler mh;
  5787.     short balance;
  5788.     if (!PyArg_ParseTuple(_args, "O&",
  5789.                           CmpInstObj_Convert, &mh))
  5790.         return NULL;
  5791.     _rv = GetSoundMediaBalance(mh,
  5792.                                &balance);
  5793.     _res = Py_BuildValue("lh",
  5794.                          _rv,
  5795.                          balance);
  5796.     return _res;
  5797. }
  5798.  
  5799. static PyObject *Qt_SetSoundMediaBalance(_self, _args)
  5800.     PyObject *_self;
  5801.     PyObject *_args;
  5802. {
  5803.     PyObject *_res = NULL;
  5804.     HandlerError _rv;
  5805.     MediaHandler mh;
  5806.     short balance;
  5807.     if (!PyArg_ParseTuple(_args, "O&h",
  5808.                           CmpInstObj_Convert, &mh,
  5809.                           &balance))
  5810.         return NULL;
  5811.     _rv = SetSoundMediaBalance(mh,
  5812.                                balance);
  5813.     _res = Py_BuildValue("l",
  5814.                          _rv);
  5815.     return _res;
  5816. }
  5817.  
  5818. static PyObject *Qt_FindNextText(_self, _args)
  5819.     PyObject *_self;
  5820.     PyObject *_args;
  5821. {
  5822.     PyObject *_res = NULL;
  5823.     ComponentResult _rv;
  5824.     MediaHandler mh;
  5825.     Ptr text;
  5826.     long size;
  5827.     short findFlags;
  5828.     TimeValue startTime;
  5829.     TimeValue foundTime;
  5830.     TimeValue foundDuration;
  5831.     long offset;
  5832.     if (!PyArg_ParseTuple(_args, "O&slhl",
  5833.                           CmpInstObj_Convert, &mh,
  5834.                           &text,
  5835.                           &size,
  5836.                           &findFlags,
  5837.                           &startTime))
  5838.         return NULL;
  5839.     _rv = FindNextText(mh,
  5840.                        text,
  5841.                        size,
  5842.                        findFlags,
  5843.                        startTime,
  5844.                        &foundTime,
  5845.                        &foundDuration,
  5846.                        &offset);
  5847.     _res = Py_BuildValue("llll",
  5848.                          _rv,
  5849.                          foundTime,
  5850.                          foundDuration,
  5851.                          offset);
  5852.     return _res;
  5853. }
  5854.  
  5855. static PyObject *Qt_NewMovieFromScrap(_self, _args)
  5856.     PyObject *_self;
  5857.     PyObject *_args;
  5858. {
  5859.     PyObject *_res = NULL;
  5860.     Movie _rv;
  5861.     long newMovieFlags;
  5862.     if (!PyArg_ParseTuple(_args, "l",
  5863.                           &newMovieFlags))
  5864.         return NULL;
  5865.     _rv = NewMovieFromScrap(newMovieFlags);
  5866.     _res = Py_BuildValue("O&",
  5867.                          MovieObj_New, _rv);
  5868.     return _res;
  5869. }
  5870.  
  5871. static PyObject *Qt_NewTimeBase(_self, _args)
  5872.     PyObject *_self;
  5873.     PyObject *_args;
  5874. {
  5875.     PyObject *_res = NULL;
  5876.     TimeBase _rv;
  5877.     if (!PyArg_ParseTuple(_args, ""))
  5878.         return NULL;
  5879.     _rv = NewTimeBase();
  5880.     _res = Py_BuildValue("O&",
  5881.                          TimeBaseObj_New, _rv);
  5882.     return _res;
  5883. }
  5884.  
  5885. static PyObject *Qt_AlignWindow(_self, _args)
  5886.     PyObject *_self;
  5887.     PyObject *_args;
  5888. {
  5889.     PyObject *_res = NULL;
  5890.     WindowPtr wp;
  5891.     Boolean front;
  5892.     if (!PyArg_ParseTuple(_args, "O&b",
  5893.                           WinObj_Convert, &wp,
  5894.                           &front))
  5895.         return NULL;
  5896.     AlignWindow(wp,
  5897.                 front,
  5898.                 (Rect *)0,
  5899.                 (ICMAlignmentProcRecordPtr)0);
  5900.     Py_INCREF(Py_None);
  5901.     _res = Py_None;
  5902.     return _res;
  5903. }
  5904.  
  5905. static PyObject *Qt_DragAlignedWindow(_self, _args)
  5906.     PyObject *_self;
  5907.     PyObject *_args;
  5908. {
  5909.     PyObject *_res = NULL;
  5910.     WindowPtr wp;
  5911.     Point startPt;
  5912.     Rect boundsRect;
  5913.     if (!PyArg_ParseTuple(_args, "O&O&O&",
  5914.                           WinObj_Convert, &wp,
  5915.                           PyMac_GetPoint, &startPt,
  5916.                           PyMac_GetRect, &boundsRect))
  5917.         return NULL;
  5918.     DragAlignedWindow(wp,
  5919.                       startPt,
  5920.                       &boundsRect,
  5921.                       (Rect *)0,
  5922.                       (ICMAlignmentProcRecordPtr)0);
  5923.     Py_INCREF(Py_None);
  5924.     _res = Py_None;
  5925.     return _res;
  5926. }
  5927.  
  5928. static PyMethodDef Qt_methods[] = {
  5929.     {"EnterMovies", (PyCFunction)Qt_EnterMovies, 1,
  5930.      "() -> None"},
  5931.     {"ExitMovies", (PyCFunction)Qt_ExitMovies, 1,
  5932.      "() -> None"},
  5933.     {"GetMoviesError", (PyCFunction)Qt_GetMoviesError, 1,
  5934.      "() -> None"},
  5935.     {"ClearMoviesStickyError", (PyCFunction)Qt_ClearMoviesStickyError, 1,
  5936.      "() -> None"},
  5937.     {"GetMoviesStickyError", (PyCFunction)Qt_GetMoviesStickyError, 1,
  5938.      "() -> None"},
  5939.     {"DisposeMatte", (PyCFunction)Qt_DisposeMatte, 1,
  5940.      "(PixMapHandle theMatte) -> None"},
  5941.     {"NewMovie", (PyCFunction)Qt_NewMovie, 1,
  5942.      "(long flags) -> (Movie _rv)"},
  5943.     {"GetDataHandler", (PyCFunction)Qt_GetDataHandler, 1,
  5944.      "(Handle dataRef, OSType dataHandlerSubType, long flags) -> (Component _rv)"},
  5945.     {"PasteHandleIntoMovie", (PyCFunction)Qt_PasteHandleIntoMovie, 1,
  5946.      "(Handle h, OSType handleType, Movie theMovie, long flags, ComponentInstance userComp) -> None"},
  5947.     {"TrackTimeToMediaTime", (PyCFunction)Qt_TrackTimeToMediaTime, 1,
  5948.      "(TimeValue value, Track theTrack) -> (TimeValue _rv)"},
  5949.     {"NewUserData", (PyCFunction)Qt_NewUserData, 1,
  5950.      "() -> (UserData theUserData)"},
  5951.     {"NewUserDataFromHandle", (PyCFunction)Qt_NewUserDataFromHandle, 1,
  5952.      "(Handle h) -> (UserData theUserData)"},
  5953.     {"CreateMovieFile", (PyCFunction)Qt_CreateMovieFile, 1,
  5954.      "(FSSpec fileSpec, OSType creator, ScriptCode scriptTag, long createMovieFileFlags) -> (short resRefNum, Movie newmovie)"},
  5955.     {"OpenMovieFile", (PyCFunction)Qt_OpenMovieFile, 1,
  5956.      "(FSSpec fileSpec, SInt8 permission) -> (short resRefNum)"},
  5957.     {"CloseMovieFile", (PyCFunction)Qt_CloseMovieFile, 1,
  5958.      "(short resRefNum) -> None"},
  5959.     {"DeleteMovieFile", (PyCFunction)Qt_DeleteMovieFile, 1,
  5960.      "(FSSpec fileSpec) -> None"},
  5961.     {"NewMovieFromFile", (PyCFunction)Qt_NewMovieFromFile, 1,
  5962.      "(short resRefNum, short newMovieFlags) -> (Movie theMovie, Boolean dataRefWasChanged)"},
  5963.     {"NewMovieFromHandle", (PyCFunction)Qt_NewMovieFromHandle, 1,
  5964.      "(Handle h, short newMovieFlags) -> (Movie theMovie, Boolean dataRefWasChanged)"},
  5965.     {"NewMovieFromDataFork", (PyCFunction)Qt_NewMovieFromDataFork, 1,
  5966.      "(short fRefNum, long fileOffset, short newMovieFlags) -> (Movie theMovie, Boolean dataRefWasChanged)"},
  5967.     {"RemoveMovieResource", (PyCFunction)Qt_RemoveMovieResource, 1,
  5968.      "(short resRefNum, short resId) -> None"},
  5969.     {"GetVideoMediaGraphicsMode", (PyCFunction)Qt_GetVideoMediaGraphicsMode, 1,
  5970.      "(MediaHandler mh) -> (HandlerError _rv, long graphicsMode, RGBColor opColor)"},
  5971.     {"SetVideoMediaGraphicsMode", (PyCFunction)Qt_SetVideoMediaGraphicsMode, 1,
  5972.      "(MediaHandler mh, long graphicsMode, RGBColor opColor) -> (HandlerError _rv)"},
  5973.     {"GetSoundMediaBalance", (PyCFunction)Qt_GetSoundMediaBalance, 1,
  5974.      "(MediaHandler mh) -> (HandlerError _rv, short balance)"},
  5975.     {"SetSoundMediaBalance", (PyCFunction)Qt_SetSoundMediaBalance, 1,
  5976.      "(MediaHandler mh, short balance) -> (HandlerError _rv)"},
  5977.     {"FindNextText", (PyCFunction)Qt_FindNextText, 1,
  5978.      "(MediaHandler mh, Ptr text, long size, short findFlags, TimeValue startTime) -> (ComponentResult _rv, TimeValue foundTime, TimeValue foundDuration, long offset)"},
  5979.     {"NewMovieFromScrap", (PyCFunction)Qt_NewMovieFromScrap, 1,
  5980.      "(long newMovieFlags) -> (Movie _rv)"},
  5981.     {"NewTimeBase", (PyCFunction)Qt_NewTimeBase, 1,
  5982.      "() -> (TimeBase _rv)"},
  5983.     {"AlignWindow", (PyCFunction)Qt_AlignWindow, 1,
  5984.      "(WindowPtr wp, Boolean front) -> None"},
  5985.     {"DragAlignedWindow", (PyCFunction)Qt_DragAlignedWindow, 1,
  5986.      "(WindowPtr wp, Point startPt, Rect boundsRect) -> None"},
  5987.     {NULL, NULL, 0}
  5988. };
  5989.  
  5990.  
  5991.  
  5992.  
  5993. void initQt()
  5994. {
  5995.     PyObject *m;
  5996.     PyObject *d;
  5997.  
  5998.  
  5999.  
  6000.  
  6001.     m = Py_InitModule("Qt", Qt_methods);
  6002.     d = PyModule_GetDict(m);
  6003.     Qt_Error = PyMac_GetOSErrException();
  6004.     if (Qt_Error == NULL ||
  6005.         PyDict_SetItemString(d, "Error", Qt_Error) != 0)
  6006.         Py_FatalError("can't initialize Qt.Error");
  6007. }
  6008.  
  6009. /* ========================= End module Qt ========================== */
  6010.  
  6011.